Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > setTimeout in Opera Mini 4.2?

Reply
Thread Tools

setTimeout in Opera Mini 4.2?

 
 
Garrett Smith
Guest
Posts: n/a
 
      09-19-2009
I have read several sources stating that setTimeout is not implemented
in Opera Mini[1][2].

But for some odd reason, it is working for me.

Can someone clear up my confusion on this matter?

Using opera-mini-4.2.14912-advanced-en-us.jad, running on MicroEmulator.
The setTimeout function runs.

http://dhtmlkitchen.com/ape/adhoctes...eout-test.html

Result in Opera Mini 4.2.14912:
Script says: Helloooooo! from setTimeout(fun 10), delay=12

[1]http://dev.a.com/articles/view/javascript-support-in-opera-mini-4/
[2]http://developer.yahoo.com/yui/yuitest/

I'm confused as to why others say it doesn't work, but it works for me.
Can anyone help clear up the confusion as to when it was implemented or
what I did to get a different result?
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/
 
Reply With Quote
 
 
 
 
Eric Bednarz
Guest
Posts: n/a
 
      09-19-2009
Garrett Smith <(E-Mail Removed)> writes:

> Using opera-mini-4.2.14912-advanced-en-us.jad, running on
> MicroEmulator. The setTimeout function runs.
>
> http://dhtmlkitchen.com/ape/adhoctes...eout-test.html


That is a *terrible* URI reference for mobile testing (at least if you
ask other people to do it for you . Long, camelCase, hyphen, file
extension.

> [1]http://dev.a.com/articles/view/javascript-support-in-opera-mini-4/

^
http://dev.opera.com/articles/view/j...-opera-mini-4/

“[…] we don't allow scripts to run for more than a second or two once
the page has finished loading […]”

Did you even consider to try a higher timeout value than 10
milliseconds? For me, the breaking point (Opera Mini on a mobile device
connecting via GPRS) is around 150 ms. Actually with exactly 150 ms the
function sometimes runs and sometimes doesn’t. Connecting via WLAN
slighly raises that value for me, but not much, and not consistently.
 
Reply With Quote
 
 
 
 
David Mark
Guest
Posts: n/a
 
      09-19-2009
On Sep 19, 6:16*am, Eric Bednarz <(E-Mail Removed)> wrote:
> Garrett Smith <(E-Mail Removed)> writes:
> > Using opera-mini-4.2.14912-advanced-en-us.jad, running on
> > MicroEmulator. The setTimeout function runs.

>
> >http://dhtmlkitchen.com/ape/adhoctes...eout-test.html

>
> That is a *terrible* URI reference for mobile testing (at least if you
> ask other people to do it for you . Long, camelCase, hyphen, file
> extension.
>


And the test itself is awful too. Tests should be as simple and
direct as possible. The innerHTML property, implied globals, mutates
the DOM during load, type conversion of host methods, etc. Something
goes wrong here and it will be hard to blame setTimeout
exclusively.

And why would a higher delay make it work if Opera Mini is cutting off
scripts after n seconds?
 
Reply With Quote
 
Eric Bednarz
Guest
Posts: n/a
 
      09-19-2009
David Mark <(E-Mail Removed)> writes:

>>> http://dhtmlkitchen.com/ape/adhoctes...eout-test.html


> And why would a higher delay make it work if Opera Mini is cutting off
> scripts after n seconds?


But the point was that then it wouldn’t, as expected and – albeit
incompletely – documented on the Opera page Garrett mentioned).
 
Reply With Quote
 
David Mark
Guest
Posts: n/a
 
      09-19-2009
On Sep 19, 2:24*pm, Eric Bednarz <(E-Mail Removed)> wrote:
> David Mark <(E-Mail Removed)> writes:
> >>>http://dhtmlkitchen.com/ape/adhoctes...eout-test.html

> > And why would a higher delay make it work if Opera Mini is cutting off
> > scripts after n seconds?

>
> But the point was that then it wouldnt, as expected and albeit
> incompletely documented on the Opera page Garrett mentioned).


No, he mentioned a link that didn't work. What is dev.a.com supposed
to be?

I see where you corrected the link. It seems further indication of
the futility of the test.
 
Reply With Quote
 
Garrett Smith
Guest
Posts: n/a
 
      09-19-2009
Eric Bednarz wrote:
> Garrett Smith <(E-Mail Removed)> writes:
>
>> Using opera-mini-4.2.14912-advanced-en-us.jad, running on
>> MicroEmulator. The setTimeout function runs.
>>
>> http://dhtmlkitchen.com/ape/adhoctes...eout-test.html

>
> That is a *terrible* URI reference for mobile testing (at least if you
> ask other people to do it for you . Long, camelCase, hyphen, file
> extension.
>

OK.

>> [1]http://dev.a.com/articles/view/javascript-support-in-opera-mini-4/

> ^
> http://dev.opera.com/articles/view/j...-opera-mini-4/
>


That's copy pasting at 1am.

> “[…] we don't allow scripts to run for more than a second or two once
> the page has finished loading […]”
>
> Did you even consider to try a higher timeout value than 10
> milliseconds? For me, the breaking point (Opera Mini on a mobile device
> connecting via GPRS) is around 150 ms. Actually with exactly 150 ms the
> function sometimes runs and sometimes doesn’t. Connecting via WLAN
> slighly raises that value for me, but not much, and not consistently.


I have not tried higher values, but will consider making tests for that.
Also worth testing are setInterval functions and setTimeout loops.

Thanks for the pointer.
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/
 
Reply With Quote
 
Dr J R Stockton
Guest
Posts: n/a
 
      09-20-2009
In comp.lang.javascript message <h93ba6$olm$(E-Mail Removed)-
september.org>, Sat, 19 Sep 2009 12:26:56, Garrett Smith
<(E-Mail Removed)> posted:
>
>I have not tried higher values, but will consider making tests for
>that.
>Also worth testing are setInterval functions and setTimeout loops.


Try <URL:http://www.merlyn.demon.co.uk/js-dates.htm#Ress>,
<URL:http://www.merlyn.demon.co.uk/js-date0.htm#TaI>, on a PC and in
Mini. It may well not answer your question; but it could be
interesting.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
 
Reply With Quote
 
David Mark
Guest
Posts: n/a
 
      09-20-2009
On Sep 20, 11:56*am, Dr J R Stockton <(E-Mail Removed)>
wrote:
> In comp.lang.javascript message <h93ba6$(E-Mail Removed)-
> september.org>, Sat, 19 Sep 2009 12:26:56, Garrett Smith
> <(E-Mail Removed)> posted:
>
>
>
> >I have not tried higher values, but will consider making tests for
> >that.
> >Also worth testing are setInterval functions and setTimeout loops.

>
> Try <URL:http://www.merlyn.demon.co.uk/js-dates.htm#Ress>,
> <URL:http://www.merlyn.demon.co.uk/js-date0.htm#TaI>, on a PC and in
> Mini. *It may well not answer your question; but it could be
> interesting.


I suppose anything would be interesting in comparison. Still don't
see how the other "test" proves anything (certainly not that
window.setTimeout is defective in Opera Mini). Why test ridiculous
scenarios when reality is available?
 
Reply With Quote
 
Eric Bednarz
Guest
Posts: n/a
 
      09-20-2009
David Mark <(E-Mail Removed)> writes:

> […] Still don't
> see how the other "test" proves anything (certainly not that
> window.setTimeout is defective in Opera Mini).


I’m getting the idea that you misunderstood something.

Garretts post/test was about setTimeout *working* in Opera mini,
something that can resonably be perceived as contradicting (amongst
other sources) Opera documentation.

However, the statement

| I have read several sources stating that setTimeout is not implemented
| in Opera Mini[1][2].

is not really substantiated by the Opera page. Something can be
implemented and not work, in particluar circumstances and for various
reasons. window.setTimeout in OPera mini appears to work with really
small timeout values.

[1] http://dev.opera.com/articles/view/j...-opera-mini-4/


 
Reply With Quote
 
David Mark
Guest
Posts: n/a
 
      09-20-2009
On Sep 20, 5:15*pm, Eric Bednarz <(E-Mail Removed)> wrote:
> David Mark <(E-Mail Removed)> writes:
> > [] *Still don't
> > see how the other "test" proves anything (certainly not that
> > window.setTimeout is defective in Opera Mini).

>
> Im getting the idea that you misunderstood something.


Yes, I had the same idea a few posts back.

>
> Garretts post/test was about setTimeout *working* in Opera mini,
> something that can resonably be perceived as contradicting (amongst
> other sources) Opera documentation.


Yes. My mistake. Still a lousy test, but glad it managed to muddle
through. So your point is it may appear to work to a point, but watch
out if you raise the delay. Fair enough, but use another test for
that. A button that sets an input's value comes to mind.

>
> However, the statement
>
> | I have read several sources stating that setTimeout is not implemented
> | in Opera Mini[1][2].
>
> is not really substantiated by the Opera page. Something can be
> implemented and not work, in particluar circumstances and for various
> reasons. window.setTimeout in OPera mini appears to work with really
> small timeout values.


Yes, I know setTimeout works in that browser. I don't know about
large timeout values though.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opera Mini tops 100 million users William Brown NZ Computing 40 04-11-2011 09:21 AM
Opera Mini William Brown NZ Computing 0 04-08-2011 04:52 AM
2D Animation through Opera Mini najibmok Java 0 03-23-2006 10:43 AM
Mini Dual Layers? Mini dl ScubaSteve7979@gmail.com DVD Video 0 10-25-2005 07:52 PM



Advertisments