Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to view "file" in a frame

Status
Not open for further replies.

kenjshaw

Programmer
Dec 18, 2002
2
US
I want to use javascript to display a local file in a frame.

I was using parent.frames[1].location.href="file:/home/filename.txt"

But this no longer works is new browsers I get

illegal URL method 'file:'

How can a view a local file?
 
Looking at your syntax above, can I assume you're on a Linux/Unix machine?

The correct syntax is:

file:///c:/home/file.txt under windows.

or

file:///home/file.txt under Linux/Unix

RKM
 
rkmarcks,

Thanks for the input. But I have a routine in the javascript that corrects for NT vs Unix and outputs the correct syntax file:///c| or file://.

This does work if I enter the "file:" directly as a URL in the browser, but does not work in the javascript, I still get the "illegal URL" error for Unix or NT.

What I am attempting to do (and this works in older browser versions) is to let the end user display an image from thier local machine in a frame to compare to a stored image in another frame.

This is for an itranet application.

Would appreiate any help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top