pilau
08-08-2006, 07:35 PM
Let's say I have an HTML page in the root directory "/".
Now, in the folder (root)/scripts, I have a .js file which is included in the HTML file.
In the JavaScript code I am settin a new source URL for an image in the HTML page. The image is located inside the folder (root)/images.
So, for calling the image from the HTML file I would do this: src="./images/image.ext". But from what is the directory path I should use from the JS file? imageObject.src = 'what path?'
Now, in the folder (root)/scripts, I have a .js file which is included in the HTML file.
In the JavaScript code I am settin a new source URL for an image in the HTML page. The image is located inside the folder (root)/images.
So, for calling the image from the HTML file I would do this: src="./images/image.ext". But from what is the directory path I should use from the JS file? imageObject.src = 'what path?'