I’m currently trying to pass values using an AJAX request to a server side end point. Everything works fine until I try to pass a decimal value in the url. I understand that the . character is a reserved character in the url and am wondering how I can pass a decimal value in my AJAX request.
My current endpoint is something like this; /domain/some-url/?value1=5&value2=2.3
The above url results in a 404.
If I change value2 to a whole number or a string it works file. Example would be /domain/some-url/?value1=5&value2=2
I get a successful response from the above URL.
Is there a standard way of deal with this situation?
It’s not the dot per se. Why would a dot be a reserved character in a URL? In that case you wouldn’t be able to use
/img/someimg.jpgetc. It must have something to do with the way your server handles the request.To be sure, I have tested this using one of my own server side testscripts @
http://testbed.nicon.nl/v8test/json.xjs?testone=0.234&test2=4.56. The script is found and working like it should, no problem with the decimals.