locked
need help in appending child node RRS feed

  • Question

  • I am opened window.open(child.aspx page) from the parent.aspx file
    
    the below code is from parent.aspx,
    ....
    <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.
    
    objDoc.xml = <?xml version="1.0" encoding="utf-8"?><Student><Class/><Books/><OtherDetails/></Student>
    
    
    The below code is from child.aspx.
    .....
    <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. :(
    Wednesday, December 2, 2009 6:33 AM