Hi - I am using a CMS. Through this I can post images to the index page of my site. What I want to know is it possible to add an body onload tag to an image field so that when the image displays it autoredirects to a different page.
At the moment I've tried using this:
But it redirects in my admin page rather than the main index page.Code:<body onload="window.location.replace('http://www.testsite.com')">
Basically I want people when they connect to index.php to be automatically redirected to a different page, but I can't actually physically edit the source of the script, so am wondering if there is an easy way of adding this code to a field in the admin page that will load it into the index page, and I figured that doing it through an image might be the easiest thing to do.
I want to remotely change the page, so think it's something in the 'window.location' tag that needs changing, perhaps to 'window.location.href'?
Any suggestions appreciated.



Reply With Quote

Bookmarks