Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hello,


I have a webpage where i have referred a local .js file which is stored in c:\abc\abc.js.

How can i determine whether the file exists or not?

I cant use JQuery in my project, So is there any normal java script way to determine this?

Best regards,
Prasanth.k
Posted

1 solution

If you work through the HTTP server, this is on the server side, no way.

You cannot use the file with such location. You cannot use absolute path names at all. A Web application is executed in sandboxed environment which won't allow you to access any files beyond the root directory of your site.

And even if you don't use any server and develop just a collection of HTML/JavaScript files (such as documentation), using of absolute paths just cannot be useful. Stay out of trouble.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900