Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    iframe.open() problem

    Hello, i have a .js script with this code:

    document.write('<IFRAME HEIGHT="20" WIDTH="500" SCROLLING="NO" style="border-width:0" name="iframe" ID="iframe"></IFRAME>');
    function start() {
    window.frames.iframe.document.open();
    window.frames.iframe.document.write('<HTML>');
    window.frames.iframe.document.write('<SCRIPT LANGUAGE="Javascript" src="msglib.js" type="text/javascript"></SCRIPT>');
    window.frames.iframe.document.write('<BODY topmargin="0" leftmargin="0">');
    window.frames.iframe.document.write("<a href=\"javascriptrevious()\">Previous</a>&nbsp;");
    getmsg();
    window.frames.iframe.document.write("&nbsp;<a href=\"javascript:next()\">Next</a>");
    window.frames.iframe.document.write('</BODY>');
    window.frames.iframe.document.write('</HTML>');
    window.frames.iframe.document.close();
    }

    and have a problem when I write this line:

    window.frames.iframe.document.write('<SCRIPT LANGUAGE="Javascript" src="msglib.js" type="text/javascript"></SCRIPT>');

    the script are loading without end (I use FireFox), can I change this line with another similar, or can anyone tell me what is wrong ?

    Thank you

  • #2
    Regular Coder
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    375
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    window.frames.iframe.document.write('<script src="msglib.js" type="text/javascript"><'+'/'+'script>');
    That should do it unless there is something strange about msglib.js.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •