Forum Moderators: open

Message Too Old, No Replies

absolute paths in external javascript file

absolute paths in external javascript file

         

lobo235

11:35 pm on Feb 23, 2005 (gmt 0)

10+ Year Member



I have an external javascript file that I am loading using the following code in my index.html:
<script type="text/javascript" src="includes/header.js"></script>

Inside my javascript file I have the following line of code:
document.write(' <a href="index.html"><img src="images/logo.gif" alt="Company Logo" border=0 /></a>\n');

My question is about the relativity of the img tag that points to "images/logo.gif". From the root where index.html resides, is this going to load the image from "includes/images/logo.gif" or "images/logo.gif"?

Bernard Marx

2:12 am on Feb 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The script writes the tag to the document.
So...

lobo235

2:36 am on Feb 24, 2005 (gmt 0)

10+ Year Member



That's what I thought. Thank you for confirming.