This is probably simple, but I can not find the answer ...
I have an ajax call that returns html
dataType: "html"
and he will return. msg looks like this:
<div id="x"><p>Hello</p></div>
and gets the dom add to the top of the parent div:
ajax call...
request.done(function(msg) {
$('#parent').prepend(msg);
}
The problem is that I SHOULD NOT do this dom manipulation if the text has not changed (since there are other effects that occur when I am truncated. (This is a notification that checks for updates in the interval)
so I want to find "Hello" in msg and compare it with the current xp div, which may already be on the page. This second part is easy to handle, but in the first part I need to do something like msg.text () to just get "Hello", but several options that I tried failed.
pointers?