By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 992 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

Can html load javascript files from the local machine?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.