Manipulate AJAX Function on Success

 $.ajax({
        url: "url.com",
        type: "GET",
        success: function (data){


          $(data). //how?

        }
    });

This data object returns an HTML page, and I just want to get a specific DIV from the data object. I tried $ (data) .find ('id / class'), but it only returns a string. I tried $ ("div" data); it returns the whole div, but not the one I want with some id. Im out of ideas, can anyone help?

+4
source share
1 answer

If your data is successfully answered, you should analyze yours HTMLand apply a filter to it.

var result =  $($.parseHTML(data)).filter("div#your_id"); 
+1
source

All Articles