code_junkie

Loading XHTML fragments over AJAX with jQuery

Nov 11th, 2011
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. uncaught exception: Node cannot be inserted at the specified point in the hierarchy (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR)
  2. http://localhost:8000/static/1222832186/pixra/script/jquery-1.2.6.js
  3. Line 257
  4.  
  5. $body = $("#div-to-fill");
  6. $.get ("/testfile.xhtml", undefined, function (data)
  7. {
  8. console.debug ("data = %o", data); // data = Document
  9. $body.children ().replaceWith (data); // error
  10. }, 'xml');
  11.  
  12. <?xml version="1.0" encoding="UTF-8"?>
  13. <div xmlns="http://www.w3.org/1999/xhtml">
  14. <form action="/gallery/image/edit-description/11529/" method="post">
  15. <div>content here</div>
  16. </form>
  17. </div>
  18.  
  19. $body = $("#div-to-fill");
  20. $.get ("/testfile.xhtml", function (data)
  21. {
  22. $body.html($(data).children());
  23. }, 'xml');
Add Comment
Please, Sign In to add comment