I think you guys are making this too complicated. Just loop through the data
properties:
function dataChanged( a, b ) {
for( var key in a )
if( a[key] != b[key] ) return true;
return false;
}
if( dataChanged(o,n) ) {
someAJAXFunctionThatSavesTheFiel
Thanks. I'll give that a go. Otherwise, I'll just write 2 different
functions: one for comparison (I'll probably compare hashes using the
sha1 plugin) and one for sending the data to the backend.
> var o = $("#original-fields"), n = $("#new-fields");
> if (o != n) { // <-- BRICK WALL
> someAJAXFunctionThatSavesTheFieldsThatChanged();
> }
> How can I compare the #original-fields data with the #new-fields
> data? As it is, the two always differ; I assume this is because they
> are diff
3 matches
Mail list logo