Ho cercato di confrontare questi due oggetti JSON:Come confrontare due JSON hanno le stesse proprietà senza ordine?
<input type="hidden" id="remoteJSON" name="remoteJSON" value='{"allowExternalMembers": "false", "whoCanJoin": "CAN_REQUEST_TO_JOIN"}' /><br />
<input type="hidden" id="localJSON" name="localJSON" value='{"whoCanJoin": "CAN_REQUEST_TO_JOIN", "allowExternalMembers": "false"}' /><br />
ho ottenuto valori con javascript e ho cercato di confrontare con: JSON.stringify(remoteJSON) == JSON.stringify(localJSON)
ma questo return false: cuciture che l'ordine delle proprietà è importante.
E anche in profondità confrontare con this solution e sempre ottenuto un ritorno falso.
C'è un modo rapido per risolvere il problema con jQuery (es. Librarie per confrontare JSON)?
si dovrebbe leggere questo http://stackoverflow.com/questions/171251/how-can-i-merge-properties-of-two-javascript-objects-dynamically –
Could mostraci come stai provando il confronto profondo. –
"e ha sempre un ritorno falso" --- no, non http://jsfiddle.net/pyLqhujo/ Se quella funzione restituisce 'false' significa letteralmente che i tuoi oggetti ** sono ** diversi. – zerkms