Possible to refresh a javascript via link click?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2099201/javascript-hard-refresh-of-current-page">Javascript hard refresh of current page</a>  </p>
</blockquote>



<p>I have a random image javascript that loads a random image on page load. I would like to load another random image when clicking a link named "Random image".  Here is the page:
<a href="http://www.heybrian.com/" rel="nofollow">http://www.heybrian.com/</a></p>

<p>The way it is now, the "Random image" link just refreshes the entire page which pulls in a new random image.</p>

<p>EDIT:</p>

<p>Below is the (truncated) javascript code. Please note that there are about 100 random photos that can load, but I've only included four, to simplify:</p>

<pre><code>images = new Array(99);

images[0] = "&lt;div id='content_white_border' style='border: 1px white solid;'&gt;&lt;div id='content_photo'&gt;&lt;a href = 'travels/thailand/2004/ko_tao.php'&gt;&lt;img src='lib/images/travels/thailand/2004/ko_tao_mango_bay.jpg' alt='' width='956' height='512' border='0' /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;h4&gt;Mango Bay (Taa Toh Bay), Ko Tao &amp;mdash; April 9, 2004&lt;/h4&gt;";

images[1] = "&lt;div id='content_white_border' style='border: 1px white solid;'&gt;&lt;div id='content_photo'&gt;&lt;a href = 'travels/france'&gt;&lt;img src='lib/images/travels/france/eiffel_close.jpg' alt='' width='956' height='512' border='0' /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;h4&gt;La Tour Eiffel, Paris, France &amp;mdash; November 26, 2006&lt;/h4&gt;";

images[2] = "&lt;div id='content_white_border' style='border: 1px white solid;'&gt;&lt;div id='content_photo'&gt;&lt;a href = 'travels/china/2007/hangzhou.php'&gt;&lt;img src='lib/images/travels/china/2007/hangzhou_gold_buddha.jpg' alt='' width='956' height='512' border='0' /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;h4&gt;Buddha image,  Língyǐn Temple &lt;span lang='zh' xml:lang='zh'&gt;灵隐寺&lt;/span&gt;, Hángzhōu, China &amp;mdash; August 2, 2007&lt;/h4&gt;";

images[3] = "&lt;div id='content_white_border' style='border: 1px white solid;'&gt;&lt;div id='content_photo'&gt;&lt;a href = 'travels/sri_lanka'&gt;&lt;img src='lib/images/travels/sri_lanka/elephant_baby_wide.jpg' alt='' width='956' height='512' border='0' /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;h4&gt;Baby at the elephant breeding center, Kandy, Sri Lanka&lt;/h4&gt;";

images[4] = "&lt;div id='content_white_border' style='border: 1px white solid;'&gt;&lt;div id='content_photo'&gt;&lt;a href='travels/mongolia/'&gt;&lt;img src='lib/images/travels/mongolia/man_baby_3_wide.jpg' alt='' width='956' height='512' border='0' /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;h4&gt;Mongol and his baby, Mongolia &amp;mdash; July 2006&lt;/h4&gt;";

index = Math.floor(Math.random() * images.length);
document.write(images[index]);
</code></pre>
