Cant go back until the whole page is loaded
i have an auto generate php gallery that preload all the images while the thumbnails are loading.. it load one thumb and after preload the actual image with it.. the problem is that i cant go back until i click the stop loading button..
<script type="text/javascript">
if (document.images) {
img1 = new Image();
img1.src ="../album/1000";
}
</script>
this is the preloading script and this is the back button script:
<div id="topbar" style="display: block;">
<div id="leftnav">
<a href="../mindex.php">Go back</a></div></div>
the thing is i found how to stop the loading on clicking the go back button but it wont load my开发者_高级运维 page or go to the href.. thanks ahead
Try Putting the part that loads the images in a function which is called just after the page is loaded. Something like this:
<script>
function load(){
// some loading script
}
</script>
<body onload="load();">
This means that your page will load all the html, but everything on the screen, and just then call the 'load' function. This could make the page look a little wired until everything is loaded. But the browser should respond.
Wow i cant believe it was that simple:\ i tried so many things!!! my stupid solution is to add
<a href="your/link/" target="_self" onclick="window.stop();"></a>
to the link.. i forgot that i have this script who prevent my pages to open new tabs because its a web app..
精彩评论