PHP class that changes an image and reloads the page not displaying new image in Internet Explorer
I have a class that runs a function when the image is clicked on to display an additional image. This function produces a linked div tag that reloads the page with a set of variables that then produces another image. The image is set as a background image on a large div tag behind the linked div tags to give the same effect as开发者_运维知识库 an image map but without using an image map or a SVG. This works perfectly in Chrome and Firefox but will not display the new image in Internet Explorer until you F5 the page again with the get variables in the URL?
Does anyone know how to fix this issue so that it works in IE the same as the other browsers?
Many thanks.
I have looked at this and it does not matter if I use the background-image:(someimage.png) or img src='someimage.png' because the image name remains the same but IE caches the image until a force reload is executed. Therefore I have changed the image name dynamically each time by using the following.
$str = explode(".", $iFilename);
$fName = $str[0] . "_" . mktime() . "." . $str[1];
$this->filename = $fName;
I am not sure if there is another way of doing this that does not involve changing the filename so I am open to suggestions?
精彩评论