Struggling with compatibility issues between Firefox and IE? I've been experiencing frustration, especially with Firefox automatically decoding a parameter in the hash before I can manipulate it in Javascript. Unlike IE, which does not automatically decode the URL, leading to fewer reading errors.
My dilemma bears similarity to this issue, although I am not utilizing ASP.NET ASP.NET MVC automatically decoding JSON-encoded parameters from AJAX
Imagine taking a URL like
example.com/#question=!%40%23%24%25^%26*(
where the "!%40%23%24%25^%26*(" was encoded using encodeURIComponent. In IE, when accessing the hash, it remains as is; however, in Firefox, it undergoes automatic decoding into "!@#$%^&*("
The predicament arises because my script employs decodeURIComponent to decode the already encoded value. While this works fine for genuinely encoded strings, the pre-decoded content in Firefox triggers a malformed URI sequence error, while IE remains unaffected.
Seeking guidance on how to resolve this puzzling discrepancy?