Help me with this issue when learning ajax : HierarchyRequestError: Node cannot be inserted at the specified point in the hierarchy
I am new to Jquery and Ajax also. when i try the example of one tutorial on the internet I got this issue.
Description:
I use ajax to get data from the php script and display result to html page by .html(result)
Code:
index.html
- $(document).ready(function() { $.ajax({ url : 'get.php', type : 'get', data : 'name=nhan', async : true, success : function(result) { $("body").html(result); } })
get.php
- $name = $_GET['name'];
echo $name;
But the code above get error : I copy from firebug:
HierarchyRequestError: Node cannot be inserted at the specified point in the hierarchy
fragment.appendChild( elem );
I read jquery documentation and try both way. above and $.get() but get the same issue.
Please help me, it makes me so confuse.
I can not continue to learn the rest of ajax if this issue cannot be resolve. Help me please!