IE7 and window.location.assign to local file

Hi.

We have a web app where we need to at some point use javascript to redirect the user to a local html file. That is where the html file (for example) exists in c:\folder

The javascript used to do this is simply window.location.assign(url) here is the actual code snippet:

Code Block
var fileUrl = "file:///projects/play_local.htm";
window.location.assign(fileUrl);

This works just fine in IE 6 but in IE 7 it gives a javascript error
"Error Invalid procedure call or argument"

I have tried changing out the file:/// part of the URL with "file:///c:/projects/play_local.htm"; but then it just gives an Access Denied error and I have tried using window.location.href and window.location.replace but nothing works.

What changed in IE 7 to stop allowing this? Is there a security setting that can be changed to allow the local file to replace the current window? Keep in mind, this is an internal web application and would only affect employees at our company.

Is there another solution for this that anyone has come across? I have searched a lot on google and other sites and not found anything to fix it.

Thank you in advance.

Tyler

[1462 byte] By [thegonz14] at [2008-1-10]
# 1

Hi,

window.location=fileUrl;

or

window.navigate(fileURL);

should work for all browsers. IE7 may have security zone settings about navigating across domains with lesser security privaledges.

Regards.

IECUSTOMIZER at 2007-10-3 > top of Msdn Tech,Internet Explorer Development,Internet Explorer Web Development...
# 2
Thanks for the response and suggestions.

I have tried that it still doesn't work. If I what you have above I just get the error "Invalid argument"

I tried looking around for IE 7 security settings and tried enabling everything that seemed to relate but no luck.

Any other ideas?

Tyler

thegonz14 at 2007-10-3 > top of Msdn Tech,Internet Explorer Development,Internet Explorer Web Development...