By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,077 Members | 1,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,077 IT Pros & Developers. It's quick & easy.

location.href ignores assignment and loads a blank page

P: n/a
I have a webpage(with a text field and a button) which prompts for a
local file and attempts to load the file in the window if the user
clicks on the button. The javascript code onClick event uses the
location.href property to achieve the desired result. (This loaded
page has some additional functionality which lets them upload the
contents to the server.)

This approach only seem to work for some computers and on others it is
loading a blank page. I have alerts in the code to show that
location.href is correctly reflecting the file location after the
assignment. When it is loading the blank page I see the message
"Opening page about:blank" on the status bar. Iam currently using IE6
sp1 on Win2k. This issue is not just limited to this combination. We
are experiencing issues with IE5.5, WinXP as well.

The code works if I pass a web site address. It only fails if I
attempt to pass a file name(c:\test.htm)

Any thoughts on why the blank page is being loaded or how can I go
about resolving this issue.

TIA
-Ravi
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Ravi wrote:
I have a webpage(with a text field and a button) which prompts for a
local file and attempts to load the file in the window if the user
clicks on the button. The javascript code onClick event uses the
location.href property to achieve the desired result. (This loaded
page has some additional functionality which lets them upload the
contents to the server.)

This approach only seem to work for some computers and on others it is
loading a blank page. I have alerts in the code to show that
location.href is correctly reflecting the file location after the
assignment. When it is loading the blank page I see the message
"Opening page about:blank" on the status bar. Iam currently using IE6
sp1 on Win2k. This issue is not just limited to this combination. We
are experiencing issues with IE5.5, WinXP as well.

The code works if I pass a web site address. It only fails if I
attempt to pass a file name(c:\test.htm)

Any thoughts on why the blank page is being loaded or how can I go
about resolving this issue.

TIA
-Ravi


Hi,

maybe this helps:
try:
file://c:\test.htm

which of course is not a href, but maybe it works.

Regards,
Erwin
Jul 20 '05 #2

P: n/a
I had tried that before. Did not work. No matter how I specify the file
name the end result was the same. When I get a blank page the properties
for the page indicates that the Address(URL) property is "about:blank".

As mentioned in my previous post, it is only happennig on few computers
and not on others. Is there a any setting (security?) in the browser or
computer that is forcing it to load a blank page?

-Ravi

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.