469,631 Members | 1,532 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,631 developers. It's quick & easy.

Displaying Calender html pages in IFRAME automatically using JavaScript

hi All,

I am using the following code to display the calender html pages in IFRAME automatically using javscript

<script language="JavaScript">
var d = new Date();
var month = d.getMonth() + 1;
var result;
function openCalender() {
if (month==1) { result="calender1/Jan08.htm"; return result;}
if (month==2) { result="calender1/Feb08.htm"; return result;}
if (month==3) { result="calender1/Mar08.htm"; return result;}
if (month==4) { result="calender1/Apr08.htm"; return result;}
if (month==5) { result="calender1/May08.htm"; return result;}
if (month==6) { result="calender1/Jun08.htm"; return result;}
}
</script>


<iframe src="<script>document.write(openCalender());</script>" width="480" frameborder="0" align="middle" height="300"></iframe>

I tried this. But it not working. Page can't be found error I am getting. Please suggest me how can I solve this problem .

Thanks,
Rafeeq
Feb 21 '08 #1
1 1599
rnd me
427 Expert 256MB
you cannot write in the middle of another tag.

make the iframe code complete and normal, perhaps defaulting to january08.html.

then set the iframe's .src property to the result of the openCalender function in a lower script section.
Feb 21 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by lordslayer | last post: by
4 posts views Thread by Chris | last post: by
3 posts views Thread by jobs at webdos | last post: by
7 posts views Thread by gubbachchi | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.