iPhone / iPod Touch mailto link destroys javascript timers -


In the Mobile Safari on iPhone or iPod Touch, if a user clicks on the mail links and then returns to the page (either Send or cancel), timers no longer function inside javascript. I have posted a bug for apple, and on OpenDr.

However, I was thinking that before anyone has come on it and come up with some sort of solution.

Update: Here is some sample code

  & lt ;! DOCTYPE html public "- // W3C // DTD XHTML 1.0 Strongly //n" "http://www.w3.org/TR /xhtml1/DTD/xhtml1-strict.dtd"> & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Top & gt; & Lt; Title & gt; Trial & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; H1 id = "normal" & gt; Normal: 0 & lt; / H1> & Lt; H1 id = "timed" & gt; Time: 0 & lt; / H1> & Lt; H1 id = "interval" & gt; Interval: 0 & lt; / H1> & Lt; An id = "clicker" & gt; Click me & lt; / A & gt; & Lt; Br / & gt; & Lt; A href = "mailto:" & gt; Mail to & lt; / A & gt; & Lt; Script type = "text / javascript" & gt; Window.addEventListener ('Load', function () {var number = 0; var interval = 0; var id; document. GetElementById ('clicker'). AddEventListener ('click', function) {interval = 0; count ++ ; InlineHTML = 'timed:' + count;}, 100); id = ';' SetInterval (function () {interval ++; if (interval> 5) {clear interval (id); return;} document.getElementById ('interval'). InnerHTML = 'interval:' + interval;}, 200) ;}, wrong) ; }, false); & Lt; / Script & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

To clear some obvious confusion about what I am saying, this is a bug, it is not that when you leave the page and whatever was going on, It is returned to any timer, it stops being expected. The problem is that once the users start a new timer, they will never come in the fire.

This is not a 'bug' because the browser application is actually locked when the mail application launches when user Returns, it is restored, but the scripts running on it will be stopped.

Although it is not very good, it is expected.


Comments