Google Answers Logo
View Question
 
Q: Problems with DOM image replacement / image cache code in Firefox ( No Answer,   0 Comments )
Question  
Subject: Problems with DOM image replacement / image cache code in Firefox
Category: Computers > Internet
Asked by: trimidium-ga
List Price: $3.00
Posted: 05 Sep 2005 11:43 PDT
Expires: 05 Oct 2005 11:43 PDT
Question ID: 564515
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 &current_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&current_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&current_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
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy