Firefox do not load script defined on local disk (this work in IE6)

J

jeanph01

Hi,
Can someone explain to me why this is not working in Firefox (even in
safe mode) ? The problem exist only when the js script is on the local
drive. If I access it remotely (using the path defined in the
commented out line), this works.

My html :
<html>
<head>
<!--script src="https://jqueryjs.googlecode.com/files/
jquery-1.3.2.min.js" type="text/javascript"></script-->
<script src="D:\Temp\jquery.js" ></script>

<script type="text/
javascript">
$(
function() {
$("<span>Jquery chargé!</span>").appendTo("body");
}
);
</script>
</head>
<body>
</body>
</html>

I saved a copy of https://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js
in D:\Temp\jquery.js.

Could it be that the Firefox load the js file after executing the call
to $() ?

Thank you for your help !
 
M

Martin Honnen

jeanph01 said:
Can someone explain to me why this is not working in Firefox (even in
safe mode) ? The problem exist only when the js script is on the local
drive. If I access it remotely (using the path defined in the
commented out line), this works.

My html :
<html>
<head>
<!--script src="https://jqueryjs.googlecode.com/files/
jquery-1.3.2.min.js" type="text/javascript"></script-->
<script src="D:\Temp\jquery.js" ></script>

Try a URL:
<script type="text/javascript"
src="file:///D:/Temp/jquery.js"></script>
 
J

jeanph01

Try a URL:
       <script type="text/javascript"
src="file:///D:/Temp/jquery.js"></script>

This works in Firefox and IE !
Thanks !!
So what I understand is "file:///" is the correct syntax for accessing
local files in URL format. Right ?
 

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,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top