470,614 Members | 1,438 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,614 developers. It's quick & easy.

Can html load javascript files from the local machine?

ray
I have a html file stored as the D:/proj/test.html. In the html file I
wish to load a javascript file---test.js which is stored in the same
directory as test.html.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8"/
>
<TITLE>Test Page</TITLE>
<SCRIPT type="text/javascript" src="test.js"/>
...
</HEAD>
</HTML>
But when I open the test.html from the hard disk, it seems that the
javascript is loaded.
Can html load javascript files from the local machine?
Thanks in advance.
Jun 27 '08 #1
2 7698
ray scribed:
>I have a html file stored as the D:/proj/test.html. In the html file I
wish to load a javascript file---test.js which is stored in the same
directory as test.html.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8"/
>>
<TITLE>Test Page</TITLE>
<SCRIPT type="text/javascript" src="test.js"/>
...
</HEAD>
</HTML>
But when I open the test.html from the hard disk, it seems that the
javascript is loaded.
Can html load javascript files from the local machine?
Thanks in advance.
Yes.
--
Ed Jay (remove 'M' to respond by email)
Jun 27 '08 #2
ray
On Apr 23, 9:20 am, Ed Jay <ed...@aes-intl.comwrote:
ray scribed:
I have a html file stored as the D:/proj/test.html. In the html file I
wish to load a javascript file---test.js which is stored in the same
directory as test.html.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8"/
<TITLE>Test Page</TITLE>
<SCRIPT type="text/javascript" src="test.js"/>
...
</HEAD>
</HTML>
But when I open the test.html from the hard disk, it seems that the
javascript is loaded.
Can html load javascript files from the local machine?
Thanks in advance.

Yes.
--
Ed Jay (remove 'M' to respond by email)
Sorry, my mistake. That javascript file seems not be loaded.
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

27 posts views Thread by Michael C | last post: by
17 posts views Thread by chris.schwalm | last post: by
1 post views Thread by kevin.a.sweeney | last post: by
42 posts views Thread by Santander | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.