Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing external javascript file on local machine

Status
Not open for further replies.

gordo3

MIS
Joined
Apr 30, 2006
Messages
3
Location
US
Greetings

I am attempting to run a web page on localhost ( that accesses an external javascript file (scripts.js). The page just renders blank. If I embed the javascript the page renders correctly. Javascript file is located in same directory as index (test). My external file contains only code and my script tag in head section of index.html is correct.

<script type = "text/javascript" src = "scripts.js" />

My asp.net pages work fine and my pages access other external files, such as css. My local server is IIS 5.1 on Windows XP Pro.

Any idea why external .js file won't work? Any suggestions would be appreciated. Thanks for your help.
 
Page still renders blank; no error, just blank.
 
Well, I did close it the same as your first reply. However I just changed the code to explicitly close the script tag as in your last reply and it works. I am writing the site using the xhtml 1.1 doctype. I thought I could still implicitly close empty tags as <script /> but I guess I was incorrect in my assumption.

Thanks for your insight.
 
Since the <script> tag has an explicit </script> closing tag, you need to use that, as you discovered. Would you use

<td />

to create an empty <td>?

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top