Hi all,
I am virtually a total novice and would greatly appreciate any help.
I have my own website and the front page was getting too convulated with different news items.
So I thought I would make something to only show one random item after the latest bits of information.
I tried using iframes like this
Code:
<script language="JavaScript1.2">
//Random iframe content- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, and Terms Of use, visit http://dynamicdrive.com
//This credit MUST stay intact for use
var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1
var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1
//Specify IFRAME display attributes
var iframeprops='width=100% height=250 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="yes"'
//Specify random URLs to display inside iframe
var randomcontent=new Array()
randomcontent[0]="random1.htm"
randomcontent[1]="random2.htm"
randomcontent[2]="random3.htm"
//No need to edit after here
if (ie||dom)
document.write('<iframe id="dynstuff" src="" '+iframeprops+'></iframe>')
function random_iframe(){
if (ie||dom){
var iframeobj=document.getElementById? document.getElementById("dynstuff") : document.all.dynstuff
iframeobj.src=randomcontent[Math.floor(Math.random()*randomcontent.length)]
}
}
window.onload=random_iframe
</script>
This then gives me the following problems.
The files randomx.html are all various sizes so I get a gap after the text.
All the links in the randomx.html files open up in that iframe.
And finally I have been told iframes is not very SEO friendly and it could all be done much simpler and SEO friendlier in html.
If any one has got any ideas on how I can improve this or can point me in the direction where I can find I will be eternally grateful.
Thanks For Reading
Rich