I use encodeURI() to encode a php request url, it works perfectly fine in Firefox and Chrome but it doesn't in IE/Edge.
The actual url is:
http://localhost/get.php?id=e_e2&title=e2&desc=just a note&stime=6/12/2015, 1:00:00 AM&etime=15/12/2015, 1:00:00 PM
What Firefox returns is (works):
http://localhost/get.php?id=e_HO%20Event%201&title=HO%20Event%201&desc=This%20is%20just%20a%20test%20event%20of%20this%20handover%20only&stime=6/12/2015,%201:00:00%20AM&etime=10/12/2015,%201:00:00%20PM
What IE returns (Break the php code):
http://localhost/get.php?id=e_HO%20Event%201&title=HO%20Event%201&desc=This%20is%20just%20a%20test%20event%20of%20this%20handover%20only&stime=%E2%80%8E6%E2%80%8E/%E2%80%8E12%E2%80%8E/%E2%80%8E2015%E2%80%8E%20%E2%80%8E1%E2%80%8E:%E2%80%8E00%E2%80%8E:%E2%80%8E00%E2%80%8E%20%E2%80%8EAM&etime=%E2%80%8E10%E2%80%8E/%E2%80%8E12%E2%80%8E/%E2%80%8E2015%E2%80%8E%20%E2%80%8E1%E2%80%8E:%E2%80%8E00%E2%80%8E:%E2%80%8E00%E2%80%8E%20%E2%80%8EPM
I have tried to decode what IE returns but it caused me a lots of problems!, so is there an alternatives to encodeURI() ?, FF seems to work even if I dont encode the url, where IE works if I copy the FF encoded url to it!
update: example code link
I think it has something to do with toLocaleString()
Final update:
As few answered, it was some weard marks in the link "appears only in IE!" I had to filter and changes what my php script date format to remove the comma
function FixLocaleDateString(localeDate) {
var newStr = "";
for (var i = 0; i < localeDate.length; i++) {
var code = localeDate.charCodeAt(i);
if (code != 44 && code != 8206 ) {
newStr += localeDate.charAt(i);
}
}
return newStr;
}
I found this function in another answer and modify it: ToLocaleDateString() changes in IE11