Suppose that you can retrieve an HTML page through a call by using the jQuery.get()
function, e.g. as follows:
$.get('xxx.php',
function(data) {
//handle data, that is HTML code....
});
Is there any jQuery solution to extract elements (e.g. div, ul and so on) by the data
variable?
PS: I don't believe that using load()
to load page fragments is a good idea since I want to minimize the number of server requests.
Just make the HTML returned a jquery object and you can use any DOM functions normally.