I have a response from an AJAX request using jQuery returned as 'response'
I need to compare it with old HTML. If it is different it will just do some css.
The problem is it detects a different change everytime even when there is no difference and there is a continueous loop which makes my animation on css repeat itself.
Anyone help?
var oldHTML = $("#container").html();
$.ajax({
url: "ajax/log.php",
cache: false,
dataType: "JSON",
success: function(response){
if(oldHTML != response){ $("#container").css({"border":"1px solid red"}),$("#container").animate({"border":"none"}); }
}
It does not always detect a change or no change. It also loops the animation bit :S