How to get div on ajax response!!
Nowadays, We like to use jQuery to submit forms or use AJAX for many small small things, But sometimes we need only specific div to perform action or do something but the problem is AJAX returns full page data in response, getAjax.php :
Suppose you’re calling ajax to getAjax.php from index.html and you want only “.class1″ content in response to append in “#main”, Here’s the code :
index.html :
Nowadays, We like to use jQuery to submit forms or use AJAX for many small small things, But sometimes we need only specific div to perform action or do something but the problem is AJAX returns full page data in response, getAjax.php :
Suppose you’re calling ajax to getAjax.php from index.html and you want only “.class1″ content in response to append in “#main”, Here’s the code :
index.html :
No comments:
Post a Comment
Please leave your comments and we will be reply you back ASAP
vikas agrawal