javascript - Getting a part of another webpage using jQuery $.post() method -


i know load() method jquery can 1 part based on class or id of element this:

$( "#result" ).load( "ajax/test.html #container" ); 

this load content in #container. i'm looking post method, post data page, data used change #container element , want display what's in element.

is way do?

thanks.

use .filter() .post(), like

$.post("some_url", function(data) {    var container = $(data).filter("#container");    $( "#result" ).html(container); }); 

btw, use $.get() instead of $.post()

added: using $.get(),

$.get( "some_url", function( data ) {     var container = $(data).filter("#container");     $( "#result" ).html(container); }); 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -