Seven wrote:
I simply would like to load a random html page from an array into an
iframe upon refresh or visit. Every time the user visits the site a
diferent news article (html page) will present itself in the iFrame.
Including random content is a FAQ here. Please do a minimum of research
on previous articles before you post. <URL:http://jibbering.com/faq/>
FWIW: Include something like the following in the `body' element of your
HTML document.
<script type="text/javascript">
var
a = ["b", "c", "d"],
rnd = Math.floor(Math.random() * a.length),
url = a[rnd];
document.write([
'<iframe src="' + url + '" ...>',
' <a href="' + url + '">Go to article #' + rnd + '<\/a>',
'<\/iframe>'
].join("\n"));
</script>
Note that if you really want to use this client-side scripting instead of
the server-side scripting recommended here, users without client-side
script support will not see anything.
HTH
PointedEars