Solved

XMLHTTP and Hourglass Cursor

Posted on 2001-07-07
5
545 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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