Is there any way to detect the mobile blocked screen in a web app?
<p>Is there any way to detect the mobile blocked screen in a web app? When the screen obscures. To stop a loop of Ajax requests. Another way?
I use Javascript and jQuery.</p>

<p>Edit: </p>

<p>My web app makes Ajax request, started for a loop. This loop doesn't stop because it obtains the state of a lamp. If other window or tab in the browser is visited, the Ajax request stops (using <code>focus</code> and <code>blur</code> methods). Why? To optimize the performance. The problem is in mobile devices. The app may crash if the loop continue for a lot.</p>

<p>If the mobile screen is blocked and I unblock it, occurs the next event?</p>

<pre><code>$(window).focus(function() { 
   //action code 
});
</code></pre>
