I am getting the whole html page in responseText, i just want to parse/
filter the responseText to
get a specific div say test and underlying contents. I would not
like to modify the server side code to send just required div in
responseText.
url: "Someurl",
datatype: "text/html",
success : function(responseText)
{
alert(responseText);
dat = $(data).filter("#test").html();
alert(dat);//getting null
$('#test').html(dat);
}
responseText contains
100’s of HTML lines….
….
….many more div tags and other
tags
….
100’s of HTML lines
I’m using jquery and i tried
$(responseText).filter("#test").html();
and used find too
If you have only html in the response AND your intention is to pinpoint a DIV using a unique ID, then it might be even easier than the example I gave earlier.
Try something like this