location.href ignores assignment and loads a blank page

R

Ravi

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
 
E

Erwin Moller

Ravi said:
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
 
R

Ravi Muthyala

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top