M
Martin Larsen
Hi,
I have a script for a CMS that preloads an image by setting the SRC
attribute. The problem is that the location of the image as seens from
the final HTML page depends on whether the CMS has search engine
friendly (SEF) url's urned on.
If it is not on, the location is just the normal absolute location of
the image, and it is then easy to fetch it.
However, if SEF is on, the location could be anything. Pre-loading the
image will then usually fail because the url deduced by the script would
be wrong.
But the image is located relatively to the script itself, so if the
script could just determine "where I am" it would be a piece of cake to
get the address of the image!
But is it possible for a script to determine its own location?
Regards,
Martin
I have a script for a CMS that preloads an image by setting the SRC
attribute. The problem is that the location of the image as seens from
the final HTML page depends on whether the CMS has search engine
friendly (SEF) url's urned on.
If it is not on, the location is just the normal absolute location of
the image, and it is then easy to fetch it.
However, if SEF is on, the location could be anything. Pre-loading the
image will then usually fail because the url deduced by the script would
be wrong.
But the image is located relatively to the script itself, so if the
script could just determine "where I am" it would be a piece of cake to
get the address of the image!
But is it possible for a script to determine its own location?
Regards,
Martin