I am looking to write a very simple JavaScript that fades a set of 4 header logo's in and out in sequence.
The script itself is no problem and I can put it into an external .js file and link that into the site. However, I am wondering what is the best way to go about handling the location of the images themselves.
If I write absolute URLs into the Javascript I assume that they will not get rewritten by the WCM and so if the root path of the site changes, the JS will need editing. But as the Javascript will be writing to the page after the WCM has rendered the content, I assume that using the iMIS URL replacement codes in the Javascript wouldn't work either?
Is there a code that I can put into the javascript to keep the URLs dynamic even if the root path changes? Or have I missed some obvious JavaScript trick that could help here?
You should be able to use
You should be able to use the variable gWebRoot (defined by iMIS) to represent the current root path, like so:
Eric Means
System Architect, ASI