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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Javascript, Dynamic iFrame and Firefox

    Well, I finally had a question where I didn't find an answer already on the boards so I had to register.

    I've got a page that creates an iframe and uses javascript to write to it.

    Works like a charm in IE but not Firefox.

    Demo: http://www.cafewish.com/jstest.html

    Code:
    <script language="JavaScript"><!--
    document.write ('<iframe width="100" height="100" name="myframe" src="blank.htm" FRAMEBORDER="1" scrolling="no"></iframe>');
    document.frames[0].document.open();
    document.frames[0].document.writeln('<html><head></head><body>');
    document.frames[0].document.writeln('YO!</body></html>');
    document.frames[0].document.close();
    //--></script>
    What I get in IE is the "YO!" written to the iframe. What I get in Firefox is the 404 not found page of the site where the original "jstest.html" page and script are hosted.

    Any help would be greatly appreciated.

  • #2
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by TheRealJLo View Post
    What I get in IE is the "YO!" written to the iframe. What I get in Firefox is the 404 not found page of the site where the original "jstest.html" page and script are hosted.
    The answer awaits you in the JavaScript console.
    For the edification of future readers, frames is a property of window.

  • Users who have thanked Arty Effem for this post:

    TheRealJLo (08-28-2007)

  • #3
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I didn't get the JavaScript Console figured out, but I took the hint and it works great. Thank you very much. Now to go figure out how to work this console. Looks like a great tool!


  •  

    Posting Permissions

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