My website (www.thesmartass.info) loads 2 random images everytime the
page is loaded (unless random script is replaced with a cookie first).
However I wanted to add a small script that would allow people to
quickly change the backgrounds and artwork without forcing them to set
a cookie and lock it to a certain background on my customize page.
To do this I put a very small DOM image replacement script, and
pointed the scripts to my random image script. Clicking the button
should load a new random image evey time you click the button.
This works perfectly in Internet Explorer, but in Firefox, it switches
to a random picture 1 time, and then continues to say "transferring
data from thesmartass.info" until you load something else, clicking
the button again does not load a new image even once the
"transfering..." message is gone.
I do not know if this is a problem with the way firefox cache's
images, or my simple script itself.
Please tell me a way to make this script work exactly the same in
firefox and IE. Below is my entire index page, as you see I tried
putting no-cache codes as well as adding a ¤t_timestamp to the
end of my random script, neither one helped.
------------------ index.php page for www.thesmartass.info ----------
<?php include("include/monstercookie.inc"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
The SmartAss DOT Info ~ 400+ Playable Nintendo Games, Streaming
TV & Radio + Much More! (THE Ultimate Internet START Page!)
</title>
<?php
if (empty($page)) {
$main = "content";
}
?>
<?php include("include/metatags.inc"); ?>
<META HTTP-EQUIV="Expires" CONTENT="-1">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="cache-Control" CONTENT="no-cache, no-store, must-revalidate">
<meta content="progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=15,
Duration=1.0)" http-equiv="Site-Enter" />
<meta content="progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=15,
Duration=.5)" http-equiv="Site-Exit" />
<meta content="progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=15,
Duration=.5)" http-equiv="Page-Enter" />
<meta content="progid:DXImageTransform.Microsoft.Pixelate(MaxSquare=15,
Duration=1)" http-equiv="Site-Exit" />
<link rel="alternate" type="application/atom+xml" title="Born
SmartAss" href="http://www.thesmartass.info/blog/atom.xml" />
<link rel="service.post" type="application/atom+xml" title="Born
SmartAss" href="https://www.blogger.com/atom/6495229" />
<link rel="EditURI" type="application/rsd+xml" title="RSD"
href="http://www.blogger.com/rsd.g?blogID=6495229" />
<link rel="stylesheet" type="text/css" href="include/smartass5.css" />
<link rel="SHORTCUT ICON" href="favicon.ico" />
<style type="text/css">
/*<![CDATA[*/
.c2 {z-index: 3;}
body { background-color: Black; overflow: hidden; }
html { overflow: hidden; }
/*]]>*/
</style>
<script type="text/javascript">
function setBg()
{
var x=document.images
x[0].src="http://www.thesmartass.info/images/bg/random3.php?pic=random1¤t_timestamp"
}
</script>
<script type="text/javascript">
function setArt()
{
var x=document.images
x[1].src="http://www.thesmartass.info/images/artwork/random.php?pic=random1¤t_timestamp"
}
</script>
</head>
<body>
<div style="position: absolute; top: 1px; left: 1px; z-index: 150;">
<form>
<input type="button" onclick="setArt(); return true" alt="Click to
Change Artwork on the Fly" value="A">
</form>
</div>
<div style="position: absolute; bottom: 1px; left: 1px; z-index: 150;">
<form>
<input type="button" onclick="setBg(); return true" alt="Click to
Change Background on the Fly" value="B">
</form>
</div>
<!--
The Smart Ass DOT Info - Created by James Lyngaas
-->
<!-- Start Random-Cookie Background -->
<div id="bgframe" class="bgcookie">
<img alt="Background, Use Corner Buttons to Change!" src="<?php
echo getBG();?>" width="100%" height="100%" />
</div>
<!-- End Random-Cookie Background -->
<!-- Start Get Artwork -->
<div id="artframe" class="artworkcookie">
<img alt="artwork" src="<?php echo getArt();?>" height="100%" />
</div>
<!-- End Get Artwork -->
<table cellspacing="0" class="maxed" border="0">
<tr>
<td valign="top" class="maxed c2" align="center">
<iframe allowtransparency="true" scrolling="no" width="100%"
height="100%" id="layoutframe" name="layoutframe" class="lframe"
src="layout.php" frameborder="0"></iframe>
<iframe allowtransparency="true" scrolling="no" width="100%"
height="100%" id="contentframe" name="contentframe" class="cframe"
src="<?php echo $main; ?>.php" frameborder="0"></iframe>
</td>
</tr>
</table>
</body>
</html>
------------------ index.php page for www.thesmartass.info ----------
James Lyngaas
www.thesmartass.info |