做
var old = /*value*/ function loop(){ if (/*value*/ != old){ //check if the value is not old //do stuff } old = /*value*/ //set old to value requestAnimationFrame(loop) //loop every frame } requestAnimationFrame(loop) //wait a frame
或
var old = /*value*/ function changed(){ var change = /*value*/ != old //check if the value is not old old = /*value*/ //set old to value return change //output change }
並將 /*value*/ 替換為要檢查的值:)
以上是如何檢查 javascript webbrowser 中的值是否已更改的詳細內容。更多資訊請關注PHP中文網其他相關文章!