www.webdeveloper.com
Results 1 to 5 of 5

Thread: How to apply "cloneNode()" on NS7?

  1. #1
    Join Date
    Feb 2004
    Location
    Cairo, Eygpt.
    Posts
    86

    How to apply "cloneNode()" on NS7?

    Hello every body!
    The following script works OK for ie6, but I do not know how to modified to make it work on ns7.
    In other words, how may I cloneNode an IFRAME object with ns7?
    PHP Code:
    <HTML>
    <
    SCRIPT>
    function 
    Begin(){
       
    FRdocument.all.IFRM.cloneNode(); attribs="";
       for(
    at=0at FR.attributes.lengthat++)
         if(
    FR.attributes[at].specified == trueattribs+= FR.attributes[at].name+"\n";
       
    alert(attribs);
    }    
    </SCRIPT>
    <BODY onload="Begin()">
       <IFRAME id="IFRM" src="about:blank" style="border:1px solid black; position:absolute; top:20px; left:30px; width:350px; height:300px;">
    </IFRAME>
    </BODY>    
    </HTML> 
    Lotfi MA.

  2. #2
    Join Date
    Aug 2004
    Location
    Edinburgh
    Posts
    244
    your code fails because Moz doesn't support IE's proprietory document.all collection!

    to access the iframe, you need to use the document.getElementById method, which, as of version 5+ browsers, is cross-browser compatible.

  3. #3
    Join Date
    Feb 2004
    Location
    Cairo, Eygpt.
    Posts
    86
    Thanks Dear jbot for trying to help.

    What you have noted is correct and I know it, but by changing the statement:
    "FR= document.all.IFRM.cloneNode();"
    to:
    "FR= document.getElementById("IFRM").cloneNode();"
    the script still fails on NS7, giving me the following error message - which I am not able to benefit thereof:
    Error: uncaught exception: [Exception... "Not enough arguments [nsIDOMHTMLIFrameElement.cloneNode]"!

    Do you know what should I do accordingly?
    Thanks.
    Lotfi MA.

  4. #4
    Join Date
    Aug 2004
    Location
    Edinburgh
    Posts
    244
    that's because you probably can't clone a frame, iframe or otherwise. what exactly are you trying to achieve - it may be better to use a full CSS layout instead.

  5. #5
    Join Date
    Feb 2004
    Location
    Cairo, Eygpt.
    Posts
    86
    Thank you very much indeed Dear jbot!

    I will try again utilizing your advice.
    have a good day.
    Lotfi MA.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles