I've implemented changing src of an image using javascript but I don't want any javascript in my website now. So I need help to do that in PHP! :)
What am I doing:
In the main index.php file,
<body onload="load_images();">
Then I include a random file
include("content_to_display.php");
At the end of content_to_display.php,
<script type='text/javascript'>
function load_images()
{
document.getElementById('pic').setAttribute('src','/resources/resource/features/old_old_website/preview.png' );
}
</script>
and each image has an id
<img src="blank.jpg" id="pic"/>
How can I complete change that javascript into a PHP code?
Please help! I tried searching on google without much help.