This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Changing the curser while the page is loading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Changing the curser while the page is loading" Watch "Changing the curser while the page is loading" New topic

Changing the curser while the page is loading

Rahul Ashar

Joined: Apr 01, 2007
Posts: 20
Hi All,

I have a jsp page loaded according to the user selection of drop down menus
first drop down menu populates second and second populates third
however, while doing this to and fro to DB it takes some time

Can someone please explain how can i change the curser while the
page loads. and again change to original state once data recvd.
I want to stop user clicking another links


Rahul Ashar

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63227

That is not something JSP -- a server-side mechanism -- can help you with. I have moved this to a more appropriate forum.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Zaeed McColin
Ranch Hand

Joined: Jan 13, 2009
Posts: 90
If your send and receiving data be in Ajax system you can do something
maybe we have many solution and standard methods but i say my solution
1:you want change cursor to "busy" through data processing and change it to normal after process
It's easy to solve
you can do it with CSS
try this

as you see if you want start to send and process call it with "true" and after process call it with "false" parameter

about problem no 2.
you want to stop user clicking another links

OK i say my solution again
by default i think you can not say to browser disable links
but you can do another thing

let's see how can we do it?
look in anchor tag we have a attribute "href" that on clicking tag browser change direction to it
so what do we do?
we remove each href value and store the value somewhere
maybe you can understand with a sample
look at this tag
<a href="">King</a>
on clicking this tag browser go for google anyway
now we change <a href=">king</a>" TO (something like)<a href="#" X=""/>King</a>

as you saw we add a custom attribute to each anchor for store href value, because we want stop to change URL via clicking an anchor

look at this code
this function read all of the anchors, get the href values, store them in another attribute

as you see if you call it with true value, all anchorss goes for "#" and for false they come back with original values
We have a big problem here
so what is this?
OK check this two way
1: {
call changeA() with true
function get all hrefs values and store them to X and change values to "#"

call if with false
function set original hrefs
2: {
call changeA() with true
function get all hrefs values and store them to X and change values to "#"

(by a mistake or problem) call changeA() with true AGAIN
hrefs values changed to "#" with previous call, so Xs will changes to "#" and we missed original values

as you saw it's really big bug
we can sole it with a global variable or a if

so now we have optimized function

as you see we check the X attribute in each change
also you can change hrefs value to another value instead of "#" such as "javascript:alert('links disable through file processing')"

and a sample of all

also you can change onClick attribute of any tag if you want and necessar
I know that I teach like Chines language but hope you understood

Open source
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Changing the curser while the page is loading
It's not a secret anymore!