Slow 'onclick' response in IE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew C

    Slow 'onclick' response in IE

    Hi, folks.

    I've recently been doing a few simple tests and experiments. As a result,
    I've noticed that, in dealing with 'onclick', IE seems less able than
    Firefox to keep up with rapid clicking. In fact, Firefox seems to be able to
    keep up with me no matter how rapidly I click, whereas IE... well, doesn't!

    The following snippet of code demonstrates this (on my machine it does
    anyway):

    <html>
    <body onload="valueEl ement = document.getEle mentById('value ')">
    <p id="value">0</p>
    <p><input type="button" onclick="valueE lement.innerHTM L++"
    value="Incremen t"></input></p>
    </body>
    </html>

    Can anyone else confirm that IE is unable to keep up with rapid clicking of
    the button in this code, and that it's not just something wrong on my
    machine? Does anyone have any suggestions on making IE respond more quickly?

    Thanks in advance for any info.

    A.


  • [on]

    #2
    Re: Slow 'onclick' response in IE



    On Nov 6, 12:03 pm, "Andrew C" <nonse...@total ly.made.upwrote :
    Hi, folks.
    >
    I've recently been doing a few simple tests and experiments. As a result,
    I've noticed that, in dealing with 'onclick', IE seems less able than
    Firefox to keep up with rapid clicking. In fact, Firefox seems to be able to
    keep up with me no matter how rapidly I click, whereas IE... well, doesn't!
    >
    The following snippet of code demonstrates this (on my machine it does
    anyway):
    >
    <html>
    <body onload="valueEl ement = document.getEle mentById('value ')">
    <p id="value">0</p>
    <p><input type="button" onclick="valueE lement.innerHTM L++"
    value="Incremen t"></input></p>
    </body>
    </html>
    >
    Can anyone else confirm that IE is unable to keep up with rapid clicking of
    the button in this code, and that it's not just something wrong on my
    machine? Does anyone have any suggestions on making IE respond more quickly?
    >
    Thanks in advance for any info.
    >
    A.
    I'm no expert on this, but it seems that when a "Double Click" event it
    fired on IE it won't trigger the "Single Click".

    Adding:
    ondblclick="val ueElement.inner HTML++"
    to the Button allows IE to keep up with your clicks.

    But this adds a problem with FireFox, as a Double Click would trigger
    both the ondblclick and onclick, hence counting twice.

    I'd suggest searching on cross browser ways of solving this, maybe
    disabling the doubleclick when not IE.

    Comment

    • Andrew C

      #3
      Re: Slow 'onclick' response in IE


      "[on]" <switchable@gma il.comwrote in message
      news:1162822077 .335349.206800@ k70g2000cwa.goo glegroups.com.. .
      >
      On Nov 6, 12:03 pm, "Andrew C" <nonse...@total ly.made.upwrote :
      >Hi, folks.
      >>
      >I've recently been doing a few simple tests and experiments. As a result,
      >I've noticed that, in dealing with 'onclick', IE seems less able than
      >Firefox to keep up with rapid clicking. In fact, Firefox seems to be able
      >to
      >keep up with me no matter how rapidly I click, whereas IE... well,
      >doesn't!
      >>
      >The following snippet of code demonstrates this (on my machine it does
      >anyway):
      >>
      ><html>
      ><body onload="valueEl ement = document.getEle mentById('value ')">
      ><p id="value">0</p>
      ><p><input type="button" onclick="valueE lement.innerHTM L++"
      >value="Increme nt"></input></p>
      ></body>
      ></html>
      >>
      >Can anyone else confirm that IE is unable to keep up with rapid clicking
      >of
      >the button in this code, and that it's not just something wrong on my
      >machine? Does anyone have any suggestions on making IE respond more
      >quickly?
      >>
      >Thanks in advance for any info.
      >>
      >A.
      >
      I'm no expert on this, but it seems that when a "Double Click" event it
      fired on IE it won't trigger the "Single Click".
      >
      Adding:
      ondblclick="val ueElement.inner HTML++"
      to the Button allows IE to keep up with your clicks.
      >
      But this adds a problem with FireFox, as a Double Click would trigger
      both the ondblclick and onclick, hence counting twice.
      >
      I'd suggest searching on cross browser ways of solving this, maybe
      disabling the doubleclick when not IE.
      Thank you! That seems to be it.

      I now catch the 'ondblclick' event and check 'navigator.appN ame' to
      determine if the browser is 'Microsoft Internet Explorer'. If it is, I
      duplicate the 'onclick' behaviour for it; if it's not IE, I do nothing. It
      works fine.

      Any idea whether it's IE or FF that's doing the 'right' thing (or at least
      the most common thing)? Is it safe to have one set of behaviour for IE, and
      something else for all other browsers, or is FF the odd one out? Any clue?

      Thanks again.

      A.


      Comment

      • VK

        #4
        Re: Slow 'onclick' response in IE


        Andrew C wrote:
        Hi, folks.
        >
        I've recently been doing a few simple tests and experiments. As a result,
        I've noticed that, in dealing with 'onclick', IE seems less able than
        Firefox to keep up with rapid clicking. In fact, Firefox seems to be able to
        keep up with me no matter how rapidly I click, whereas IE... well, doesn't!
        It is not relevant to IE but to Windows OS. It has special option
        "Detect accidental double clicks" on by default. It means that for each
        two clicks that can be interpreted as one double click (same place,
        short enough interval) the system applies rather complicated neuristic
        trying to guess was it indeed double click or an error. You see this
        neuristic in action rather often on your desktop: when "by web-habit"
        you double click an icon on the desk but only one application instance
        is launched.

        It also means that you should not use doubleclick event handler for
        your Web solutions: *never*. To see your sample "working" you can
        change your registry settings. If you don't have TweakUI installed, see
        <http://www.winguides.c om/registry/display.php/965/for manual
        settings change.

        Naturally it doesn't help much to your future users.

        Comment

        • ASM

          #5
          Re: Slow 'onclick' response in IE

          Andrew C a écrit :
          "[on]" <switchable@gma il.comwrote in message
          news:1162822077 .335349.206800@ k70g2000cwa.goo glegroups.com.. .
          >On Nov 6, 12:03 pm, "Andrew C" <nonse...@total ly.made.upwrote :
          >>Hi, folks.
          >>>
          >>I've recently been doing a few simple tests and experiments. As a result,
          >>I've noticed that, in dealing with 'onclick', IE seems less able than
          >>Firefox to keep up with rapid clicking. In fact, Firefox seems to be able
          >>to
          >>keep up with me no matter how rapidly I click, whereas IE... well,
          >>doesn't!
          >>>
          >>The following snippet of code demonstrates this (on my machine it does
          >>anyway):
          >>>
          >><html>
          >><body onload="valueEl ement = document.getEle mentById('value ')">
          >><p id="value">0</p>
          >><p><input type="button" onclick="valueE lement.innerHTM L++"
          >>value="Increm ent"></input></p>
          >></body>
          >></html>
          >>>
          >>Can anyone else confirm that IE is unable to keep up with rapid clicking
          >>of
          >>the button in this code, and that it's not just something wrong on my
          >>machine? Does anyone have any suggestions on making IE respond more
          >>quickly?
          >>>
          >>Thanks in advance for any info.
          >>>
          >>A.
          >I'm no expert on this, but it seems that when a "Double Click" event it
          >fired on IE it won't trigger the "Single Click".
          >>
          >Adding:
          >ondblclick="va lueElement.inne rHTML++"
          >to the Button allows IE to keep up with your clicks.
          Not on mine : he is only a little less lazy.
          >disabling the doubleclick when not IE.
          why that ?
          Thank you! That seems to be it.
          Not really (for me)
          I now catch the 'ondblclick' event and check 'navigator.appN ame'
          no ... better is :

          var IE = false; /*@cc_on IE = true; @*/

          then

          onmouseup="if(I E) doThat();"
          onclick="if(!IE ) doThat();"

          Any idea whether it's IE or FF that's doing the 'right' thing (or at least
          the most common thing)? Is it safe to have one set of behaviour for IE, and
          something else for all other browsers, or is FF the odd one out? Any clue?
          I think in regard the very poor gain with astucious double click, the
          best is to leave IE runing as it's choice :-)
          and leave others browsers to do same

          --
          ASM

          Comment

          • ASM

            #6
            Re: Slow 'onclick' response in IE

            VK a écrit :
            Andrew C wrote:
            >Hi, folks.
            >>
            >I've recently been doing a few simple tests and experiments. As a result,
            >I've noticed that, in dealing with 'onclick', IE seems less able than
            >Firefox to keep up with rapid clicking. In fact, Firefox seems to be able to
            >keep up with me no matter how rapidly I click, whereas IE... well, doesn't!
            >
            It is not relevant to IE but to Windows OS.
            Again ... !

            My IE on my Mac is very lazy with proposed test, very.
            It has special option
            "Detect accidental double clicks" on by default.
            Windows ?
            If it is, why doesn't it slow FireFox's clicks ?

            (snip)
            It also means that you should not use doubleclick event handler for
            your Web solutions: *never*. To see your sample "working" you can
            change your registry settings. If you don't have TweakUI installed, see
            <http://www.winguides.c om/registry/display.php/965/for manual
            settings change.
            et ça continue ... Why not to propose a hammer ?
            Naturally it doesn't help much to your future users.
            Wonderful help.

            --
            ASM

            Comment

            • VK

              #7
              Re: Slow 'onclick' response in IE

              It is not relevant to IE but to Windows OS.
              >
              Again ... !
              Again about what?
              My IE on my Mac is very lazy with proposed test, very.
              IE on Mac is a totally different application running under totally
              different OS. Whatever however it does needs a separate investigation
              (leaving out that this software is discontinued by producer for more
              than year by now).

              If we go with "doubleclic k problem" across UA's and OS' I would insist
              for some better test case though (++innerHTML just nokes me down every
              time I look at it :(
              If it is, why doesn't it slow FireFox's clicks ?
              "lazy" and "slow" are irrelevant to the situation. It doesn't "slow",
              it makes UA to *loose* some clicks because two rapid clicks are
              interpreted as an occasional double click so UA get only one click
              instead of two.
              While IE relies on system click neuristic mentioned in my previous
              post, Firefox is trying to keep track of clicks by its own. It allows
              it to implement more complicated click sequence listeners, say in XBL
              bindings one can use onTripleClick listener.
              Why not to propose a hammer ?
              I proposed to temporary change registry settings not to solve the
              problem, but to demonstrate the root of the problem, that should be
              obvious.
              Naturally it doesn't help much to your future users.
              >
              Wonderful help.
              You have a solution to how to disable a registry setting from a
              web-page? Please share ;-)

              Comment

              • ASM

                #8
                Re: Slow 'onclick' response in IE

                VK a écrit :
                >>Naturally it doesn't help much to your future users.
                >Wonderful help.
                >
                You have a solution to how to disable a registry setting from a
                web-page? Please share ;-)
                Sure :
                onclick="alert( 'Sorry, on work...\nYou can go for a cup of coffe')"

                I do not understand at all what your are saying about Windows waiting
                eventual 2nd click.
                Each time I use a PC Win I have to re learn to double click with a very
                rapid speed (comparatively as I do on my Mac)

                About IE Mac I know it is not built as a win version (there were
                separate teams who coded them) but some commune features have had to be
                implemented. It is surprising that mine is also waiting 2nd click as
                Windows is supposed to do.

                Comment

                • VK

                  #9
                  Re: Slow 'onclick' response in IE

                  I do not understand at all what your are saying about Windows waiting
                  eventual 2nd click.
                  That's OK: a realized non-understanding is the first important step to
                  the knowledge :-)

                  In Windows OS (and some other OS) there is a OS-level click filter.
                  That is a process running on the background of all open applications.
                  This process - by applying special neuristic and by studying the type
                  of clicked object - is sorting out occasional double clicks and real
                  double clicks: for the improved user experience. Say if you double
                  clicked a submit button: the process presumes (rather reasonably IMHO)
                  that you meant just to click once, not to submit the form twice but
                  very quickly :-) Respectively the application gets a refactored event:
                  single click instead of double click.
                  Users are making double clicks instead of single ones left and right:
                  because they accustomed to double click on everything while using their
                  desktop. Without some doubleclick filter what would be a disaster.
                  It means - besides everything else - that in your web-applications you
                  *never* use and never relay on ondoubleclick handlers: they are kept
                  exclusively for legacy purposes.

                  In application to HTML button and IE it means that with trained fingers
                  one can quickly click a button 100 times but the application will get
                  only 50 single clicks. The system filter will treat your 100 clicks as
                  50 occasional double clicks and it will refactor them into 50 single
                  clicks.

                  If you want to see it in action, below is the code to play with. It is
                  essentially the OP's code: I just got rid off ++innerHTML and overall
                  brought it to a more conventional programming style.

                  Click the button with different speed. Then change your system settings
                  (must be Windows OS). Manually altering registry can be a dangerous
                  doing, so I would suggest to use unstead freely available TweakUI util
                  instead. On TweakUI go to "IE" tab and check off "Detect accidental
                  double-clicks". As it's a system setting, you'll have to restart
                  Windows after that. Click the button again to see the changes. Do not
                  forget to check it on and restart after you are done.

                  Please note that in any case accesskey (Alt+i / Apple+i) works just
                  fine with any speed without loosing events. It is because there is not
                  "ondoublekeypre ss" event so the system doesn't check it for the
                  correctness.

                  What workarounds can be suggested Web-wise?
                  1) For counters with a narrow range of values (0-10 or around) that can
                  be easily disregarded. "Click masters" will just have to make a couple
                  or so extra clicks. In any case do not forget to provide accesskey for
                  the counter.
                  2) For counters with a larger range of values click counters should not
                  be used: use sliders instead.

                  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                  "http://www.w3.org/TR/html401/loose.dtd">
                  <html>
                  <head>
                  <title>doublecl ick</title>
                  <meta http-equiv="Content-Type"
                  content="text/html; charset=iso-8859-1">
                  <script type="text/javascript">
                  var out = null;
                  var counter = 0;

                  function init() {
                  out = document.getEle mentById('out') ;
                  }

                  window.onload = init;
                  </script>
                  </head>

                  <body>
                  <p id="out">0</p>
                  <p><button type="button" accesskey="i" onclick="
                  out.innerHTML = ++counter;
                  "><u>I</u>ncrement</button></p>
                  </body>
                  </html>

                  Comment

                  • TC

                    #10
                    Re: Slow 'onclick' response in IE


                    ASM wrote:
                    Each time I use a PC Win I have to re learn to double click with a very
                    rapid speed (comparatively as I do on my Mac)
                    The doubleclick speed is readily configurable:

                    Control Panel : Mouse : Double Click Speed

                    HTH,
                    TC (MVP MSAccess)


                    Comment

                    • ASM

                      #11
                      Re: Slow 'onclick' response in IE

                      TC a écrit :
                      ASM wrote:
                      >
                      >Each time I use a PC Win I have to re learn to double click with a very
                      >rapid speed (comparatively as I do on my Mac)
                      >
                      The doubleclick speed is readily configurable:
                      Yeap !
                      I speak about default configs ...

                      Comment

                      • Andrew C

                        #12
                        Re: Slow 'onclick' response in IE


                        "VK" <schools_ring@y ahoo.comwrote in message
                        news:1162895145 .798780.91750@m 7g2000cwm.googl egroups.com...
                        >I do not understand at all what your are saying about Windows waiting
                        >eventual 2nd click.
                        >
                        That's OK: a realized non-understanding is the first important step to
                        the knowledge :-)
                        >
                        In Windows OS (and some other OS) there is a OS-level click filter.
                        That is a process running on the background of all open applications.
                        This process - by applying special neuristic and by studying the type
                        of clicked object - is sorting out occasional double clicks and real
                        double clicks: for the improved user experience. Say if you double
                        clicked a submit button: the process presumes (rather reasonably IMHO)
                        that you meant just to click once, not to submit the form twice but
                        very quickly :-) Respectively the application gets a refactored event:
                        single click instead of double click.
                        Users are making double clicks instead of single ones left and right:
                        because they accustomed to double click on everything while using their
                        desktop. Without some doubleclick filter what would be a disaster.
                        It means - besides everything else - that in your web-applications you
                        *never* use and never relay on ondoubleclick handlers: they are kept
                        exclusively for legacy purposes.
                        >
                        In application to HTML button and IE it means that with trained fingers
                        one can quickly click a button 100 times but the application will get
                        only 50 single clicks. The system filter will treat your 100 clicks as
                        50 occasional double clicks and it will refactor them into 50 single
                        clicks.
                        >
                        If you want to see it in action, below is the code to play with. It is
                        essentially the OP's code: I just got rid off ++innerHTML and overall
                        brought it to a more conventional programming style.
                        >
                        Click the button with different speed. Then change your system settings
                        (must be Windows OS). Manually altering registry can be a dangerous
                        doing, so I would suggest to use unstead freely available TweakUI util
                        instead. On TweakUI go to "IE" tab and check off "Detect accidental
                        double-clicks". As it's a system setting, you'll have to restart
                        Windows after that. Click the button again to see the changes. Do not
                        forget to check it on and restart after you are done.
                        >
                        Please note that in any case accesskey (Alt+i / Apple+i) works just
                        fine with any speed without loosing events. It is because there is not
                        "ondoublekeypre ss" event so the system doesn't check it for the
                        correctness.
                        >
                        What workarounds can be suggested Web-wise?
                        1) For counters with a narrow range of values (0-10 or around) that can
                        be easily disregarded. "Click masters" will just have to make a couple
                        or so extra clicks. In any case do not forget to provide accesskey for
                        the counter.
                        2) For counters with a larger range of values click counters should not
                        be used: use sliders instead.
                        >
                        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                        "http://www.w3.org/TR/html401/loose.dtd">
                        <html>
                        <head>
                        <title>doublecl ick</title>
                        <meta http-equiv="Content-Type"
                        content="text/html; charset=iso-8859-1">
                        <script type="text/javascript">
                        var out = null;
                        var counter = 0;
                        >
                        function init() {
                        out = document.getEle mentById('out') ;
                        }
                        >
                        window.onload = init;
                        </script>
                        </head>
                        >
                        <body>
                        <p id="out">0</p>
                        <p><button type="button" accesskey="i" onclick="
                        out.innerHTML = ++counter;
                        "><u>I</u>ncrement</button></p>
                        </body>
                        </html>
                        >
                        Thank you for a comprehensive response.

                        My original code as provided here was as uncluttered as I could make it:
                        just sufficient to make the point as clearly as possible. If I'd've realised
                        '++innerHTML' would cause sleepless nights, I might have reconsidered... ;-)

                        My experiments are part of an investigation into using JavaScript (AJAX) as
                        part of a semi-real-time online gaming infrastructure, hence my potential
                        requirement for collecting 'onclick' events as rapidly as the user cares to
                        supply them.

                        So far (as a result of this thread) I am using something like the following
                        (which appears to work well on IE and Firefox on my machine):

                        function doubleClick()
                        {
                        if (navigator.appN ame == 'Microsoft Internet Explorer')
                        {
                        singleClick();
                        }
                        }

                        function singleClick()
                        {
                        // Single-click response code:
                        // almost certainly NOT containing '++innerHTML'.. . ;-)
                        }

                        ....

                        <input type="button" ondblclick="dou bleClick()" onclick="single Click()"
                        value="Click Me"></input>

                        ....

                        A.


                        Comment

                        • VK

                          #13
                          Re: Slow 'onclick' response in IE


                          Andrew C wrote:
                          So far (as a result of this thread) I am using something like the following
                          (which appears to work well on IE and Firefox on my machine):
                          function doubleClick()
                          {
                          if (navigator.appN ame == 'Microsoft Internet Explorer')
                          {
                          singleClick();
                          }
                          }

                          function singleClick()
                          {
                          // Single-click response code:
                          // almost certainly NOT containing '++innerHTML'.. . ;-)
                          // THANK YOU :-))
                          }


                          <input type="button" ondblclick="dou bleClick()"
                          onclick="single Click()"
                          value="Click Me"></input>

                          <inputdoesn't have closing tag (<buttondoes)

                          Seems as a solution, and a "conceptualisti cal" atop of it (one
                          neuristic to fight another neuristic: I like it :-)

                          I would still spend some time (and a few hundreds of clicks) to see if
                          not caveats left on IE.

                          Comment

                          Working...