do
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
or
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 }
and replace /*value*/ with the value to check :)
The above is the detailed content of how to check if a value has changed in javascript webbrowser. For more information, please follow other related articles on the PHP Chinese website!