PDA

View Full Version : display image in footer, please help



auto
Jul 24th, 2005, 05:07 AM
How to display an image in footer only when a certain page is being visited?

I inserted an image in footer , and every webpage includes the footer, but I want it will be displayed only when a certain page is read, example, index.php.

How to make it with Javascript? please advise. thanks.

shyam
Jul 24th, 2005, 10:55 AM
window.onload = function() {
if ( /index\.php/.test(window.location) ) {
var img = document.createElement("img");
img.src = 'something.gif';
img.alt = "my image";
img.border = 0;
// find target parent
target.appendChild(img);
}
}