我使用JavaScript來做到過濾器只更新值
1 - I use hashes.js to calculate a sha1 when page loaded. store it in hidden or just a variable, or you can do sha in the server.
2 - I also do a snapshot of the form in array when page loaded. I put all my input in one class and use jQuery('forminputs').each to put them in array.
3 - when user click submit, first I do another snapshot of the form as No. 2 and compare the hash. if the hash diff, I use php.js get the updated value php.array_diff_assoc(newsnapshot, oldsnapshot). and post this to server.
雖然這些看起來很多計算的,但實際上它不是在Firefox或Chrome(永遠不要試圖IE)在所有放緩。
改變方法。把舊的價值放在文本框中,讓用戶在那裏改變。如果它相同(即用戶沒有觸及它),MySQL會注意到這一點並且不會更新它。 – itachi 2013-04-22 07:33:46
@itachi但我維護所有更新的日誌表。我如何僅使用修改後的值更新日誌表? – ben 2013-04-22 07:48:20
哈哈,你應該早點提到它。 – itachi 2013-04-22 07:57:34