Solved

XMLHTTP and Hourglass Cursor

Posted on 2001-07-07
5
539 Views
Last Modified: 2008-03-10
Ok, Basically upon an onClick, in a javascript function I do:

document.body.style.cursor = "wait";
<some long xmlhttp post which takes 5 seconds or so>
document.body.style.cursor = "auto";

The problem is the cursor doesn't change to an hourglass fast enough. The XMLHTTP post is already executing way before it has a chance to change.
I read somewhere that the user has to move the mouse in order for it to change.
Well since the odds of a mouse move in the SPLIT SECOND between the change and the xmlhttp post begin is low, I need a faster method of changing the cursor.

Putting in a delay is out of the question.
Doesn't the XMLHTTP object have any sort of built in hourglass ability?
Are you able to move the cursor with javascript? I wouldn't mind moving it a pixel somewhere to see if that will change it to the hourglass right away (I'd rather not but, if thats what needs to be done)

Any ideas?
0
Comment
Question by:Sembiance
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:mattyk
ID: 6262450
Yes unfortunatly you will usually need to move the mouse to trigger the cursor to change.  However another solution I have found is to blur and then focus back on the window object.  A quick example would be:

<body>
<script>
function testing()
{
     document.body.style.cursor = 'wait'
     window.blur();
     window.focus();

}

</script>
<a onclick="testing()">Test Link</a>

</body>

-matty
0
 

Author Comment

by:Sembiance
ID: 6262874
Sigh... I tried that and it didn't work.
All that happens now is almost the entire webpage disappears while the request takes place and then reappears after its done.

By the way  90% of the webpage is dynamically retrieved via XMLHTTP objects and so not much stays on the screen during a blur/focus.

What else can I do?
0
 
LVL 5

Accepted Solution

by:
mattyk earned 100 total points
ID: 6262921
Would you be open to using a small pop window that opens when the loading starts and then closes once things are done?
0
 

Author Comment

by:Sembiance
ID: 6273337
Not really. Anything visually noticable is not an option. I really need it to be seamless.

But maybe its not just possible.

I know I don't want to introduce an insecure active-x control just to allow the cursor to change.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6867168
Finalized by EE Moderator
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
XSL Grouping 7 38
Formatting an Excel formula to give correct date format 4 72
Specific format 21 181
PHP and Soap 3 45
The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now