The parameter is incorrect - appendChild - problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GuruPrasadBytes
    New Member
    • Nov 2009
    • 5

    The parameter is incorrect - appendChild - problem

    I am opened window.open(chi ld.aspx page) from the parent.aspx file

    the below code is from parent.aspx,
    Code:
    <HTML>
    <HEAD>
    ......
    </HEAD>
    <body onload="loadXML();">
    .....
    <input id="AddSecurityBtn" type="button" runat="server" onclick='javascript: Args[0] = objDoc.selectSingleNode('//Books'); Args[1] = buildBookTable ; Args[2] =null; window.open('child.aspx','800','900');' value="Add Books" />
    ....
    </body>
    </html>
    the fnction loadXML(); is defined in ABC.js file where it loading one templet of xml file and the object to access this xml is objDoc.

    Code:
    objDoc.xml = <?xml version="1.0" encoding="utf-8"?><Student><Class/><Books/><OtherDetails/></Student>

    The below code is from child.aspx.

    Code:
    <HTML>
    <HEAD>
    <script language="javascript">
    function addBookToXML() {
    var objDOM = new ActiveXObject("Msxml2.DOMDocument.3.0")
    var secNode = window.opener.Args[0]
    var func = opener.Args[1]
    for (var i=0; i<document.all.length; i++) {
    if (document.all(i).getAttribute("TYPE") == "checkbox"){
    if (document.all(i).checked) {
    var newNode = objDOM.createElement("book")
    newNode.setAttribute("id", document.all(i).getAttribute("id"))
    newNode.setAttribute("name", document.all(i).getAttribute("bookname"))
    newNode.setAttribute("Selected", "T")
    newNode.text = document.all(i).getAttribute("description")
    
    secNode.appendChild(newNode)      //here i an getting problem as "The parameter is incorrect"
    
    }
    }
    }
    objDOM = null
    func() 
    }
    </script>
    </HEAD>
    <body >
    ......
    <input type="button" id="SearchModeBtn" onserverclick="GetBookResults" value="Search"  runat="server">
    <input type="button" id="AddSecOK" value="OK" onclick="javascript: addBookToXML(); self.close();" runat="server">
    <input type="button" value="Cancel" id="AddSecCancel" onclick="javascript: self.close();" runat="server">
    .....
    </body>
    </html>
    GetBookResults is server side function which retrive all the books from database to child.aspx page.

    when i check secNode.xml is <Books/>
    and in newNode.xml is <book id="234" name="book234" selected="T"> Book Description in brife</book>

    expected in secNode.xml is after appending <Books><book id="234" name="book234" selected="T"> Book Description in brife</book></Books>

    this is working fine in IE7 getting problem in IE8

    fun thing is last evenining this was working fine :) . but when i started checking today morning with out changing any code... again it is give same error. :(
    Last edited by Dormilich; Dec 2 '09, 11:29 AM. Reason: Please use [code] tags when posting code
  • RamananKalirajan
    Contributor
    • Mar 2008
    • 608

    #2
    What is the error you are getting?

    Thanks and Regards
    Ramanan Kalirajan

    Comment

    • GuruPrasadBytes
      New Member
      • Nov 2009
      • 5

      #3
      secNode.appendC hild(newNode) //here i an getting problem as "The parameter is incorrect"

      Comment

      Working...