473,382 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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="valueElement = document.getElementById('value')">
<p id="value">0</p>
<p><input type="button" onclick="valueElement.innerHTML++"
value="Increment"></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.
Nov 6 '06 #1
12 9500


On Nov 6, 12:03 pm, "Andrew C" <nonse...@totally.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="valueElement = document.getElementById('value')">
<p id="value">0</p>
<p><input type="button" onclick="valueElement.innerHTML++"
value="Increment"></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="valueElement.innerHTML++"
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.

Nov 6 '06 #2

"[on]" <sw********@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
>
On Nov 6, 12:03 pm, "Andrew C" <nonse...@totally.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="valueElement = document.getElementById('value')">
<p id="value">0</p>
<p><input type="button" onclick="valueElement.innerHTML++"
value="Increment"></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="valueElement.innerHTML++"
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.appName' 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.
Nov 6 '06 #3
VK

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.com/registry/display.php/965/for manual
settings change.

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

Nov 6 '06 #4
ASM
Andrew C a écrit :
"[on]" <sw********@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
>On Nov 6, 12:03 pm, "Andrew C" <nonse...@totally.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="valueElement = document.getElementById('value')">
<p id="value">0</p>
<p><input type="button" onclick="valueElement.innerHTML++"
value="Increment"></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="valueElement.innerHTML++"
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.appName'
no ... better is :

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

then

onmouseup="if(IE) 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
Nov 6 '06 #5
ASM
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.com/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
Nov 6 '06 #6
VK
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 "doubleclick 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 ;-)

Nov 6 '06 #7
ASM
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.
Nov 7 '06 #8
VK
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
"ondoublekeypress" 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>doubleclick</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.getElementById('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>

Nov 7 '06 #9
TC

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)
http://tc2.atspace.com

Nov 7 '06 #10
ASM
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 ...
Nov 7 '06 #11

"VK" <sc**********@yahoo.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.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
"ondoublekeypress" 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>doubleclick</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.getElementById('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.appName == 'Microsoft Internet Explorer')
{
singleClick();
}
}

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

....

<input type="button" ondblclick="doubleClick()" onclick="singleClick()"
value="Click Me"></input>

....

A.
Nov 8 '06 #12
VK

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.appName == 'Microsoft Internet Explorer')
{
singleClick();
}
}

function singleClick()
{
// Single-click response code:
// almost certainly NOT containing '++innerHTML'... ;-)
// THANK YOU :-))
}
<input type="button" ondblclick="doubleClick()"
onclick="singleClick()"
value="Click Me"></input>

<inputdoesn't have closing tag (<buttondoes)

Seems as a solution, and a "conceptualistical" 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.

Nov 8 '06 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: j askey | last post by:
I have a strange bandwidth issue that I have finally tracked down to something fairly specific if anyone has any ideas... Setup: Win2003 Server, PHP 4.3.4, IIS6.0, ISAPI Network: DSL line with...
5
by: Kurt Bauer | last post by:
I have an ASP group calendar application which pulls calendar data from Exchange via webdav into an XML string. I then loop the XML nodes to populate a collection of appointments. Finally I use...
2
by: EMW | last post by:
Hi, In my datagrid I have the first column set as a buttoncolumn with linkbuttons. In my code I have some line to color the row the cursor is hovering over and what to do when the user clicks...
13
by: Chris | last post by:
I can create Javascript confirm message boxes during page creation, etc adding them to the button attributes (many good posts on this!). But how can I add this event after the button is pressed? I...
7
by: Tim::.. | last post by:
Can someone please tell me how i execute an onClick event in an asp:Image tag! I want to do the following! Thanks! <asp:Image runat="server" ID="ibtnExpandResource"...
2
by: gnomee2 | last post by:
Hello Everyone, I have a strange problem that I cannot seem to solve. I have two server running Windows 2003 MSSQL on one IIS on the other. Out of the blue I have slow queries that cause asp...
3
by: John | last post by:
Hi I have replaced an ms access app with its vb.net version at a client site. Now the clients keeps complaining about how slow the app response is. The complains they have are for example when...
2
by: markszlazak | last post by:
I'm a relatively slow response of table cells changing their background color with mouseover/our in IE6 (Win 2K) but the response is fine (fast) in Firefox. Why? The code is below. Sorry about the...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.