469,936 Members | 2,487 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,936 developers. It's quick & easy.

location.href ignores assignment and loads a blank page

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
2 3003
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
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.

Similar topics

2 posts views Thread by Steve - DND | last post: by
4 posts views Thread by Marcello | last post: by
2 posts views Thread by June Moore | last post: by
14 posts views Thread by Frances Del Rio | last post: by
10 posts views Thread by berg | last post: by
6 posts views Thread by G*rd*n | last post: by
3 posts views Thread by stephen.cunliffe | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.