473,698 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

document-wide disable of mousedown

PJ6
AJAX is great but I'd like to prevent users from clicking anything again and
causing more actions to happen while the server is working on the current
request without changing the contents of the page. I already set the pointer
to a wait cursor.

What's the best way to disable OnMouseDown document-wide?

Paul
Jan 31 '06 #1
9 3561
PJ6 wrote on 31 jan 2006 in comp.lang.javas cript:
AJAX is great but I'd like to prevent users from clicking anything
again and causing more actions to happen while the server is working
on the current request without changing the contents of the page. I
already set the pointer to a wait cursor.

What's the best way to disable OnMouseDown document-wide?


Polyurethane foam?

It is your page, so, fix your clientside script.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 31 '06 #2
PJ6
"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******** ************@19 4.109.133.242.. .
What's the best way to disable OnMouseDown document-wide?


Polyurethane foam?

It is your page, so, fix your clientside script.


This is the very reason I hate JavaScript. In order to derive a global
behavior I have to change every last godforsaken element that uses
JavaScript. I acknoweldge that some ways are better than others, but still.

Assuming I have quite a few controls with their own scripts (ASP.NET), I
would have you suggest to me which approach you recommend.

Paul
Jan 31 '06 #3

PJ6 wrote:
AJAX is great but I'd like to prevent users from clicking anything again and
causing more actions to happen while the server is working on the current
request without changing the contents of the page. I already set the pointer
to a wait cursor.

What's the best way to disable OnMouseDown document-wide?

Paul


Rather then trying to disable mouse actions, try disabling script
actions...

For example, set a Global variable when the request is sent to the
server

xmlhttp=new XMLHttpRequest( )
xmlhttp.onready statechange=xml httpChange
xmlhttp.open("G ET",url,true)
xmlhttp.send(nu ll)

Processing = true; //now we know that we are waiting for a response

then in the stateChange function (the current request was completed)...

function xmlhttpChange() {
if (xmlhttp.readyS tate==4) {
if (xmlhttp.status ==200) {
Processing = false;//now we know we've had a successful response
}
}

now before execution of any other function code, wrap a
function OtherPageAction () {
if (!Processing) {

//do other page actions like normal

} else {
UpdateSomeUserM essage("Process ing... Please Wait");
}
}

This would obviously need to be tailored to your script, but I hope the
concept helps.

Jan 31 '06 #4
PJ6 wrote on 31 jan 2006 in comp.lang.javas cript:
"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******** ************@19 4.109.133.242.. .
What's the best way to disable OnMouseDown document-wide?


Polyurethane foam?

It is your page, so, fix your clientside script.


This is the very reason I hate JavaScript. In order to derive a global
behavior I have to change every last godforsaken element that uses
JavaScript. I acknoweldge that some ways are better than others, but
still.

Assuming I have quite a few controls with their own scripts (ASP.NET),
I would have you suggest to me which approach you recommend.


No, you would not, because this is a javascript NG and not a .net one.

Javascript cannot be blamed for what other technologies do with it.

Please instead hate .net technology. They have their own NGs.

Furthermore, onmousedown is not Javascript,
in IE vbscript works just as well:

==============
<script type='text/vbscript'></script>
<button onmousedown = "for i=0 to 10:confirm(i):n ext">
count</button>
==============

Would this vbs do any better?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 31 '06 #5
PJ6 wrote:
"Evertjan." [...] wrote [...]
What's the best way to disable OnMouseDown document-wide?

Polyurethane foam?

It is your page, so, fix your clientside script.


This is the very reason I hate JavaScript. In order to derive a global
behavior I have to change every last godforsaken element that uses
JavaScript.


This does not have anything to do with the JavaScript programming language,
or any programming language for that matter. It is a Document Object Model
(DOM) issue.

<URL:http://www.w3.org/TR/DOM-Level-2-Events/events.html#Eve nts-flow>
PointedEars
Jan 31 '06 #6
PJ6
Very useful, thank you.

Paul

"Thomas 'PointedEars' Lahn" <Po*********@we b.de> wrote in message
news:19******** ********@Pointe dEars.de...
This does not have anything to do with the JavaScript programming
language,
or any programming language for that matter. It is a Document Object
Model
(DOM) issue.

<URL:http://www.w3.org/TR/DOM-Level-2-Events/events.html#Eve nts-flow>

Feb 1 '06 #7
On 2006-01-31, PJ6 <no****@nowhere .net> wrote:
AJAX is great but I'd like to prevent users from clicking anything again and
causing more actions to happen while the server is working on the current
request without changing the contents of the page. I already set the pointer
to a wait cursor.

What's the best way to disable OnMouseDown document-wide?


make synchronous requests instead of async.

--

Bye.
Jasen
Feb 3 '06 #8
Jasen Betts wrote:
On 2006-01-31, PJ6 <no****@nowhere .net> wrote:
AJAX is great but I'd like to prevent users from clicking anything again and
causing more actions to happen while the server is working on the current
request without changing the contents of the page. I already set the pointer
to a wait cursor.

What's the best way to disable OnMouseDown document-wide?


make synchronous requests instead of async.

It's possible for a synchronous request to hang until the browser times
out - 20 seconds or so. During that time, the browser (FF, MSIE) are
completely unresponsive. I tried to use abort() with a timer but of
course abort() doesn't seem to get called while the request is pending.

So is there a way to limit the timeout or cut short the request? In my
case, if it takes more than about two seconds, something is broken and I
would want to stop the process and alert the user.

Richard
Feb 5 '06 #9
Richard Kramer wrote:
Jasen Betts wrote:
On 2006-01-31, PJ6 <no****@nowhere .net> wrote:
AJAX is great but I'd like to prevent users from clicking anything again
and causing more actions to happen while the server is working on the
current request without changing the contents of the page. I already set
the pointer to a wait cursor.

What's the best way to disable OnMouseDown document-wide? make synchronous requests instead of async.


It's possible for a synchronous request to hang until the browser times
out - 20 seconds or so. During that time, the browser (FF, MSIE) are
completely unresponsive.


Which is why asynchronous XMLHTTP requests are implemented.
I tried to use abort() with a timer but of course abort() doesn't
seem to get called while the request is pending.
Of course.
So is there a way to limit the timeout or cut short the request?


Of course, some browsers allows you to configure the timeout. Apart
from that, what you want is not possible with a synchronous XMLHTTP
request. You cannot have your cake and eat it too.

The problem in this discussion is that you want "to prevent users from
clicking anything again" which cannot be done without blocking the UA.
Would it be enough to prevent them from initiating a second XMLHTTP
request while the first one is happening?
PointedEars
Feb 6 '06 #10

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

Similar topics

1
2871
by: techy techno | last post by:
Hii Just wanted to know how can I decorate my texboxes and Listmenu which is called from a JS file using the following code below: document.write("<SELECT NAME='cur2' ONCHANGE='cconv1();'>"); document.write("<OPTION VALUE='0.345066110642241'>Argentina Peso </OPTION>"); document.write("<OPTION VALUE='0.790200069503053'>Australia Dollar
2
2383
by: Brett Baisley | last post by:
Hello I have a block of html code that I want to run by calling a javascript function to print it. Its basically a table with menu items in it that is the same for many pages, and instead of copying/pasting everytime I change it, I figure this will be better, as I only change it once. The problem is, document.write doesn't handle multiple lines very well, so I was wondering what is the best way to do this? Maybe there is even a better...
2
1675
by: Edward | last post by:
The below code builds 2 tables 4 rows by 4 cols. All cells have checkboxes. When checked, the checkboxes in the first column automatically check the remainder of the check boxes in the same row. This is working fine for tables of this size. Unfortunately, my app produces lots of considerably bigger tables and the 'toggle' can take over a minute to complete!! I assume this is because for each toggle, the all form elements are searched...
1
2698
by: lawrence | last post by:
This PHP function prints out a bunch of Javascript (as you can see). This is all part of the open source weblog software of PDS (www.publicdomainsoftware.org). We had this javascript stuff working, but it only worked for IE. You can see a working version here: http://www.publicpen.com/designer/mcControlPanel.php username: designer password: designer123 However, I've tried to rewrite this so it would work in all browsers,
12
10164
by: Kepler | last post by:
How do you get the height of the client browser in IE? Both document.body.clientHeight and document.body.offsetHeight return the height of the document. If the page is long and there's a vertical scrollbar, you get the height of the entire document, screwing up any chance of centering a window in the browser using these values. Is there a way to get the height of the actual browser window and not the entire page height? Thanks.
4
5473
by: lawrence | last post by:
Can anyone tell me why this code works in Netscape 7.1 but not in IE??? <SCRIPT type='text/javascript'> function makeVisible(nameOfDiv) { document.getElementById(nameOfDiv).style.visibility='visible'; document.getElementById(nameOfDiv).style.height='auto'; if (nameOfDiv != 'weblogs')
8
8232
by: Phil Powell | last post by:
if (document.location.href.indexOf('?') >= 0) document.location.href = document.location.href.substring(0, document.location.href.indexOf('?')); if (document.location.href.indexOf('#') >= 0) { document.location.href = document.location.href.substring(0, document.location.href.indexOf('#')) + '?' + newUrl; } else { document.location.href = document.location.href + '?' + newUrl; }
5
2962
by: WilliamRLinden | last post by:
Hi world! we are pretty new to JavaScript and have been struggling for now 2 days on this problem ... We would appreciate mercy if anyone can give us some. Basically we are trying to simulate the tab key when the down arrow key is pressed. (we know there are other way to control focus flow but we use a lot of dynamic jsp fields, that will make the flow control a nightmare, we just want basic tabbing from the arrow key)
6
3373
by: therig | last post by:
I'm having issues, I've spent many hours searching and I'm a noob at javascript, any help will be greatly appreciated. I keep getting the following error: Error: document.forms.sec11_A has no properties with this script: function checkform(btntype) {
4
2638
by: dr1ft3r | last post by:
Hey guys, I'm building a site for a landscaping business down the street and can't seem to get part of the code functioning correctly. The code fails on line 68 where I make a reference to an iframe's src property. Being that IE does not follow standard and considers an id, name, etc as a qualifying identifier for the document.getElementById object, I double checked to make sure that there's only one instance of id = "servif" and I never use...
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8610
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8902
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7740
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.