Can html load javascript files from the local machine?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ray

    Can html load javascript files from the local machine?

    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.
  • Ed Jay

    #2
    Re: Can html load javascript files from the local machine?

    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)

    Comment

    • ray

      #3
      Re: Can html load javascript files from the local machine?

      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.

      Comment

      Working...