<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1036267" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1036267</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/need-help-js-single-image-reload-onmouseover#comment-1208777</link>
    <description> &lt;p&gt;Glad I could help.  &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;For the record, another way to do this would be to reset the src to &quot;&quot; (empty string), some other noise, or a cached (maybe transparent) image, and then switch back to img_src.&lt;/p&gt;
&lt;p&gt;The only danger with these alternatives is the browser may decide (maybe in a future version) to get smart and behave as before, where nothing changed.  Having it evaluate Math.random() and return a value avoids the risk entirely as the browser can&#039;t take &#039;deterministic&#039; shortcuts.&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;lazycat wrote:&lt;/strong&gt; I&#039;ll put a link to this post.. and if you ever need to create a sketch from a photo or do some crazy photo manipulation, just let me know &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;There&#039;s no need for that.  &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;And welcome to TWF.  Why don&#039;t you drop by the Introductions section and properly introduce yourself?&lt;/p&gt;
 </description>
     <pubDate>Mon, 16 Oct 2006 12:15:33 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1208777 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>It works!</title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/need-help-js-single-image-reload-onmouseover#comment-1208773</link>
    <description> &lt;p&gt;Abhishek, thank you! thank you! thank you! For fast and comprehensive reply! I checked the code in all popular browsers - works flawlessly.&lt;/p&gt;
&lt;p&gt;I&#039;ll defenitely stick around on this forum, and once I get some sleep (I am just a sorry-*** immigrant working night shift ) I&#039;ll put a link to this post.. and if you ever need to create a sketch from a photo or do some crazy photo manipulation, just let me know &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Mon, 16 Oct 2006 10:34:40 +0000</pubDate>
 <dc:creator>lazycat</dc:creator>
 <guid isPermaLink="false">comment 1208773 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/need-help-js-single-image-reload-onmouseover#comment-1208771</link>
    <description> &lt;p&gt;As one of your images says, randomness is the key.&lt;/p&gt;
&lt;p&gt;When you try to set the image&#039;s source to &quot;/message.php&quot;, Firefox notices that it&#039;s the same as string as before and doesn&#039;t bother sending a new request.  So you need to set a different string upon mouseOver each time; &lt;strong&gt;Math.random()&lt;/strong&gt; can help:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;document[img_name].src = img_src + &amp;quot;?&amp;quot; + Math.random();&lt;/code&gt;&#039;&lt;/p&gt;
&lt;p&gt;That will set the src to strings like &quot;/message.php?0.1356611673625886&quot;.  Everything after the &lt;strong&gt;?&lt;/strong&gt; is inconsequential to the PHP script, but ensures that Firefox will send a request.&lt;/p&gt;
&lt;p&gt;Also, instead of using &lt;strong&gt;document[img_name]&lt;/strong&gt;, set an &lt;strong&gt;id&lt;/strong&gt; value in the img tag instead of a &lt;strong&gt;name&lt;/strong&gt;, and use &lt;strong&gt;document.getElementById(img_id)&lt;/strong&gt;.  This is the preferred standard selector -- it won&#039;t break in modern browsers (I like your wording &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;).&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;function roll_over(img_id, img_src){&lt;br /&gt;&amp;nbsp; document.getElementById(img_id).src = img_src + &amp;quot;?&amp;quot; + Math.random();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;a href=&amp;quot;http://www.meignorant.com&amp;quot; onmouseover=&amp;quot;roll_over(&amp;#039;caveart&amp;#039;, &amp;#039;/message.php&amp;#039;)&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;/message.php&amp;quot; id=&amp;quot;caveart&amp;quot; alt=&amp;quot;CaveArt&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;Note that I&#039;ve only tested the solution in Firefox.  If it doesn&#039;t work in Opera or others, post back.  &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Mon, 16 Oct 2006 09:05:06 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1208771 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
