Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Client Side Scripting
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 11-05-2009, 12:55 PM
  #1
Wishes4U
Novice (Level 1)
 
Join Date: Nov 2009
Posts: 1
iTrader: (0)
Wishes4U is an unknown quantity at this point
Random Content on Webpage

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
Wishes4U is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart
 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 10:25 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.