jQuery check if form data are equal
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1773069/using-jquery-to-compare-two-arrays">Using jQuery to compare two arrays</a>  </p>
</blockquote>



<p>I have to send the form data via ajax to server on say every 30 second now i want it to be checked at client end and ajax been hit only in case there is any change in form.
I am using </p>

<pre><code>var lastData = "";
function saveFormInDB(){
    var $form = $("#fb_divBl0ck1").closest('form');
    var isSame = false;
    data = $form.serializeArray();
    if(lastData == ""){
        lastData = data;
    }else{
        if(lastData == data){
            isSame = true;
        }
        lastData = data;
    }
    if(!isSame){
        jqxhr = $.post("/SPSKMEForm/FormSaveServlet", data)
        .success(function() {
            if(jqxhr.responseText != ""){
                alert(jqxhr.responseText);
                alert($("#fixedFooter"));
                alert($("#fixedFooter").html());
                $("#fixedFooter").text(jqxhr.responseText).css("display", "");
                $("#fixedFooter").fadeOut("slow");
            }
        });
    }
}
</code></pre>

<p>but <code>isSame</code> is coming to be false always any help on this?</p>
