Displaying Calender html pages in IFRAME automatically using JavaScript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mohammed Rafeeq Ahmed
    New Member
    • Feb 2008
    • 1

    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="JavaS cript">
    var d = new Date();
    var month = d.getMonth() + 1;
    var result;
    function openCalender() {
    if (month==1) { result="calende r1/Jan08.htm"; return result;}
    if (month==2) { result="calende r1/Feb08.htm"; return result;}
    if (month==3) { result="calende r1/Mar08.htm"; return result;}
    if (month==4) { result="calende r1/Apr08.htm"; return result;}
    if (month==5) { result="calende r1/May08.htm"; return result;}
    if (month==6) { result="calende r1/Jun08.htm"; return result;}
    }
    </script>


    <iframe src="<script>do cument.write(op enCalender());</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
  • rnd me
    Recognized Expert Contributor
    • Jun 2007
    • 427

    #2
    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.

    Comment

    Working...