...

View Full Version : Monthly Content iFrame



Styles2304
12-27-2006, 07:27 AM
Ok, I have a javascript that creates an iframe and places month specific content (in this case a calendar) inside of it. The problem is that i need to place this calendar inside of an iframe itself. When I do this, the websites remains in a state of loading until I hit the stop button and then the website loads exactly the way it's meant to.

here is the js itself:

/***********************************************
* Monthly iframe content II- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use. Modified for Months by jscheuer1
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var ie=document.all
var dom=document.getElementById

//Specify IFRAME display attributes
var iframeprops='width=172 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"'

//Specify 12 URLs to display inside iframe, one for each month of the year
var mnthcontent=new Array()
mnthcontent[1]="calendar/indexcalendar/january.html"
mnthcontent[2]="calendar/indexcalendar/february.html"
mnthcontent[3]="calendar/indexcalendar/march.html"
mnthcontent[4]="calendar/indexcalendar/april.html"
mnthcontent[5]="calendar/indexcalendar/may.html"
mnthcontent[6]="calendar/indexcalendar/june.html"
mnthcontent[7]="calendar/indexcalendar/july.html"
mnthcontent[8]="calendar/indexcalendar/august.html"
mnthcontent[9]="calendar/indexcalendar/september.html"
mnthcontent[10]="calendar/indexcalendar/october.html"
mnthcontent[11]="calendar/indexcalendar/november.html"
mnthcontent[12]="calendar/indexcalendar/december.html"


//No need to edit after here
if (ie||dom)
document.write('<iframe id="calendar" src="" '+iframeprops+'></iframe>')

var mydate=new Date()
var myMonth=mydate.getMonth()

function monthofyear_iframe(){
if (ie||dom){
var iframeobj=document.getElementById? document.getElementById("calendar") : document.all.calendar
iframeobj.src=mnthcontent[myMonth+1]
}
}

window.onload=monthofyear_iframe

I asked the creators for help but received none. I'm wondering if it's possible to modify the code enough to be able to load correctly when placed within an iframe.

If I'm not clear enough just let me know and I'll try to explain better!

Thank You,
Styles

Styles2304
12-28-2006, 10:37 PM
Why is it SO hard to get a freakin' answer to this question? Seriously.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum