setTimeout in Opera Mini 4.2?

Discussion in 'Javascript' started by Garrett Smith, Sep 19, 2009.

  1. 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/adhoctest/setTimeout-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/
    Garrett Smith, Sep 19, 2009
    #1
    1. Advertising

  2. Garrett Smith

    Eric Bednarz Guest

    Garrett Smith <> writes:

    > Using opera-mini-4.2.14912-advanced-en-us.jad, running on
    > MicroEmulator. The setTimeout function runs.
    >
    > http://dhtmlkitchen.com/ape/adhoctest/setTimeout-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/javascript-support-in-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.
    Eric Bednarz, Sep 19, 2009
    #2
    1. Advertising

  3. Garrett Smith

    David Mark Guest

    On Sep 19, 6:16 am, Eric Bednarz <> wrote:
    > Garrett Smith <> writes:
    > > Using opera-mini-4.2.14912-advanced-en-us.jad, running on
    > > MicroEmulator. The setTimeout function runs.

    >
    > >http://dhtmlkitchen.com/ape/adhoctest/setTimeout-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?
    David Mark, Sep 19, 2009
    #3
  4. Garrett Smith

    Eric Bednarz Guest

    David Mark <> writes:

    >>> http://dhtmlkitchen.com/ape/adhoctest/setTimeout-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). :)
    Eric Bednarz, Sep 19, 2009
    #4
  5. Garrett Smith

    David Mark Guest

    On Sep 19, 2:24 pm, Eric Bednarz <> wrote:
    > David Mark <> writes:
    > >>>http://dhtmlkitchen.com/ape/adhoctest/setTimeout-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). :)


    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.
    David Mark, Sep 19, 2009
    #5
  6. Eric Bednarz wrote:
    > Garrett Smith <> writes:
    >
    >> Using opera-mini-4.2.14912-advanced-en-us.jad, running on
    >> MicroEmulator. The setTimeout function runs.
    >>
    >> http://dhtmlkitchen.com/ape/adhoctest/setTimeout-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/javascript-support-in-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/
    Garrett Smith, Sep 19, 2009
    #6
  7. In comp.lang.javascript message <h93ba6$olm$-
    september.org>, Sat, 19 Sep 2009 12:26:56, Garrett Smith
    <> 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)
    Dr J R Stockton, Sep 20, 2009
    #7
  8. Garrett Smith

    David Mark Guest

    On Sep 20, 11:56 am, Dr J R Stockton <>
    wrote:
    > In comp.lang.javascript message <h93ba6$-
    > september.org>, Sat, 19 Sep 2009 12:26:56, Garrett Smith
    > <> 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?
    David Mark, Sep 20, 2009
    #8
  9. Garrett Smith

    Eric Bednarz Guest

    David Mark <> 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/javascript-support-in-opera-mini-4/
    Eric Bednarz, Sep 20, 2009
    #9
  10. Garrett Smith

    David Mark Guest

    On Sep 20, 5:15 pm, Eric Bednarz <> wrote:
    > David Mark <> 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.


    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.
    David Mark, Sep 20, 2009
    #10
  11. Eric Bednarz wrote:
    > David Mark <> 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.
    >

    Yep.

    But I found that Opera Mini has undesirable results with
    getBoundingClientRect in Mobile View:

    http://my.opera.com/dhtmlkitchen/blog/

    > 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/javascript-support-in-opera-mini-4/
    >
    >


    That page states:
    | No background scripts running after the page is loaded will be
    | executed, and executing code using setTimeout is not possible.

    --
    Garrett
    comp.lang.javascript FAQ: http://jibbering.com/faq/
    Garrett Smith, Sep 21, 2009
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scottie T
    Replies:
    2
    Views:
    4,630
  2. A. Nonymous

    Mini search engine (call center)...

    A. Nonymous, Apr 21, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    315
    Bojidar Alexandrov
    Apr 23, 2004
  3. najibmok

    2D Animation through Opera Mini

    najibmok, Mar 23, 2006, in forum: Java
    Replies:
    0
    Views:
    437
    najibmok
    Mar 23, 2006
  4. Bob
    Replies:
    24
    Views:
    1,529
  5. Jorge
    Replies:
    3
    Views:
    134
    Gregor Kofler
    Jul 2, 2008
Loading...

Share This Page