-
-
Save cemo/3197136 to your computer and use it in GitHub Desktop.
writecapture2 mutex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mutex = false; | |
function load_ads() | |
{ | |
if (mutex) { | |
setTimeout("load_ads()", 100); // try again in 100 ms? | |
return; | |
} | |
mutex = true; | |
if (!$('#pushdown').html()) { | |
writeCapture($('#pushdown')[0], function() { setTimeout("load_ads()", 100) } ).write(pushdown_html).close(); | |
} | |
else if (!$('#leaderboard').html()) { | |
writeCapture($('#leaderboard')[0], function() { setTimeout("load_ads()", 100) } ).write(leaderboard_html).close(); | |
} | |
.... | |
mutex = false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment