Javascript DoEvents equivalent? <p>Here is my shortened code snippet:</p> <pre><code>$(document).ready(function() { $.get("/Handlers/SearchData.ashx", function(data) { json = $.evalJSON(data); }); //do some other stuff //use json data alert(json == null); }); </code></pre> <p>Alert says true because evalJson is not done processing JSON data yet (21kb gzipped). I need to wait somehow for it to finish before using that data - exactly what I'd do with DoEvents in a while loop. </p>