Friday, June 7, 2013

IE strips off parameters from pasted file URI

IE strips off parameters from pasted file URI

Question: How do I stop IE from stripping off parameters from file URI pasted into address bar?
Description of a problem: I have a "simpleTest.html" page with only this JS code inside, that returns me the current location of the browser:
console.log("document.URL: " + document.URL);
console.log("document.location: " + document.location)
console.log("document.location.href: " + document.location.href)
console.log("window.location: " + window.location)
console.log("parent.frames.document.location: " + parent.frames.document.location)
When I past address to this file in IE address bar with some parameters, for instance:
file:///pathToFile/simpleTest.html?dupa=2
The link gets changed into
file:///pathToFile/simpleTest.html
When I paste it for the 2nd time the parameters stay there. If however in the meantime I access some other resources, I will have to paste it 2 more consecutive times for parameters to remain.
Moreover, after I've place the website on my local Apache and access it through HTTP, the parameters remain.
http://127.0.0.1/pathToFile/simpleTest.html?dupa=2
It works fine for FF and Chrome, for both file and http protocols. Any ideas about this strange behavior of IE?

No comments:

Post a Comment