Gavin
Gavin

Reputation: 17382

IE6 Losing Querystring

I have a page that grabs values from the query string using javascript window.location. This works fine when run from a webserver but if I run it locally using IE6 by putting this in the address bar

c:\mysite\index.htm

Any query strings the site creates get lost and window.location just contains the location upto .htm.

I realize the example above has no query string but that page links off to pages that do. This also fails when running from a network share e.g \\server\mysite\index.htm. It seems to work fine in IE7+ and only fails in IE6.

Any ideas it's driving me crazy.

Edit : I've jsut realised this is happening on a modal window does that make any difference?

Upvotes: 0

Views: 725

Answers (4)

Gavin
Gavin

Reputation: 17382

It seems that IE6 disregards any querystrings when running locally on modal windows. Got around the problem by passing the variables into the modal window as dialog arguments rather than querystrings.

Upvotes: 0

bobince
bobince

Reputation: 536369

Query strings explicitly do not exist for URIs of the scheme ‘file’. See RFC1738. It makes no sense to put a ?query on the end of a ‘file:’ URI.

If you want to include extra location information available to scripts on the page, use a #fragment identifier and location.hash.

Upvotes: 4

Michael Borgwardt
Michael Borgwardt

Reputation: 346270

Are you aware that window.location is not a simple string, but a structured object with fields? The querystring is in window.location.search - apparently IE6 simply does not include that part when printing the parent object.

Upvotes: 0

Karl Johan
Karl Johan

Reputation: 4022

This could be a security issue in IE6. The only thing I can think of is using a HTA instead of a HTML file. Is that an option?

Upvotes: 0

Related Questions