插件窝 干货文章 如何检查 javascript webbrowser 中的值是否已更改

如何检查 javascript webbrowser 中的值是否已更改

value old frame class 582    来源:    2024-10-23


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*/ 替换为要检查的值:)