By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,261 Members | 1,658 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,261 IT Pros & Developers. It's quick & easy.

The parameter is incorrect - appendChild - problem

P: 5
I am opened window.open(child.aspx page) from the parent.aspx file

the below code is from parent.aspx,
Expand|Select|Wrap|Line Numbers
  1. <HTML>
  2. <HEAD>
  3. ......
  4. </HEAD>
  5. <body onload="loadXML();">
  6. .....
  7. <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" />
  8. ....
  9. </body>
  10. </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.

Expand|Select|Wrap|Line Numbers
  1. objDoc.xml = <?xml version="1.0" encoding="utf-8"?><Student><Class/><Books/><OtherDetails/></Student>

The below code is from child.aspx.

Expand|Select|Wrap|Line Numbers
  1. <HTML>
  2. <HEAD>
  3. <script language="javascript">
  4. function addBookToXML() {
  5. var objDOM = new ActiveXObject("Msxml2.DOMDocument.3.0")
  6. var secNode = window.opener.Args[0]
  7. var func = opener.Args[1]
  8. for (var i=0; i<document.all.length; i++) {
  9. if (document.all(i).getAttribute("TYPE") == "checkbox"){
  10. if (document.all(i).checked) {
  11. var newNode = objDOM.createElement("book")
  12. newNode.setAttribute("id", document.all(i).getAttribute("id"))
  13. newNode.setAttribute("name", document.all(i).getAttribute("bookname"))
  14. newNode.setAttribute("Selected", "T")
  15. newNode.text = document.all(i).getAttribute("description")
  16.  
  17. secNode.appendChild(newNode)      //here i an getting problem as "The parameter is incorrect"
  18.  
  19. }
  20. }
  21. }
  22. objDOM = null
  23. func() 
  24. }
  25. </script>
  26. </HEAD>
  27. <body >
  28. ......
  29. <input type="button" id="SearchModeBtn" onserverclick="GetBookResults" value="Search"  runat="server">
  30. <input type="button" id="AddSecOK" value="OK" onclick="javascript: addBookToXML(); self.close();" runat="server">
  31. <input type="button" value="Cancel" id="AddSecCancel" onclick="javascript: self.close();" runat="server">
  32. .....
  33. </body>
  34. </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. :(
Dec 2 '09 #1
Share this Question
Share on Google+
2 Replies


RamananKalirajan
100+
P: 607
What is the error you are getting?

Thanks and Regards
Ramanan Kalirajan
Dec 2 '09 #2

P: 5
secNode.appendChild(newNode) //here i an getting problem as "The parameter is incorrect"
Dec 2 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.