0

I have some standard code that looks like this

window.location.href = "/Home/Foo?Name=" + $('#Name').val() + "&Email=" + $('#Email').val();

This works as expected on a standard computer browser but it seems to fail when running on Android.
Anybody knows WHY this code does NOT work on Android ??

SF Developer
  • 5,244
  • 14
  • 60
  • 106
  • Why doesn't it work? What happens? – SLaks Dec 10 '12 at 03:31
  • it works on iPhone, on any browser from a PC ..but nothing happens in Android. The Javascript function does get called as I'm doing some validations before ..but that line of code does NOT redirect the user to the next page. U can see it at www.RightToDignity.org – SF Developer Dec 10 '12 at 19:48

1 Answers1

0

You need to escape those values by calling encodeURIComponent()

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • No. https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURIComponent – SLaks Dec 10 '12 at 19:50
  • Right ..but it works on other platforms so not sure that makes the cause for Android not to process the href value cause that page would handle no params if needed – SF Developer Dec 11 '12 at 17:21