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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to load local file on linux?

Status
Not open for further replies.

redsss

Programmer
Mar 17, 2004
72
US
on windows IE browser, this works:

Code:
<script src="c:\src\stuff.js" ...

How do I get it to work when running on linux? The following does NOT work in the browsers I've tried (mozilla, konqueror)

Code:
<script src="/src/stuff.js" ...

I've also tried using "file:/src/stuff.js" to no avail... help!
 
I don't have linux on my pc so I can't answer. But maybe if you put this in the linux forum here at tek-tips you would get the answer faster.

Thanks
Pat
ideas@microwebber.com
 

Use a file browser to locate the JS file, and then drag it into your web browser.

You should then be able to copy the URL from the address bar of your browser, and use that (including any file:// protocol, of course).

Hope this helps,
Dan
 
Since Linux provides links to one file, a possibility is

(1)
put the "real" stuff.js in say /usr/real/stuff.js.
(2)
Go to the home directory of your web page.
(3)
Here `ln` (link) to the real stuff.js.
(4)
Change your code to
"<script src="stuff.js" ...

Would this work? Please post the results and comments anyway.

BTW. I worked in Unix character basaed stuff long time ago but have no experience of web based stuff in Linux or Unix.

End
 
Thanks for the suggestion, AnanthaP, but that won't work because in this case, the html file comes from a website on the internet, and it loads in a .js file from the local computer (that is a method of authorization so that only those with the local .js files can utilize whats on the webpage).

I know there must be a simple answer to this, especially since it works under windows!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top