473,396 Members | 1,942 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,396 software developers and data experts.

Display problem

Hi,

I've written a function in javascript to obtain content using AJAX.
While AJAX is loading, I want to show a div which says "please wait
while loading. This is a part of the function:

z.style.display = "none";
y.style.display = "block";

ajax = new AjaxHandler;
nt = ajax.send("ztbl_prestationlist.asp","");

y.style.display = "none";
z.style.display = "block";

z is the container div for the ajax content, and y is a "please wait
while loading"-div.

The function is triggered with <body onload=""but also in the page
later on... When I open the page, it works perfectly, but when I
trigger the function to load other content, the div "y" does not
show...

What am I doing wrong ?
kind regards,
Mathew

Apr 4 '07 #1
2 1700
"Lupus" <ma**********@gmail.comwrote in message
news:11**********************@y66g2000hsf.googlegr oups.com...
Hi,

I've written a function in javascript to obtain content using AJAX.
While AJAX is loading, I want to show a div which says "please wait
while loading. This is a part of the function:

z.style.display = "none";
y.style.display = "block";

ajax = new AjaxHandler;
nt = ajax.send("ztbl_prestationlist.asp","");

y.style.display = "none";
z.style.display = "block";

z is the container div for the ajax content, and y is a "please wait
while loading"-div.

The function is triggered with <body onload=""but also in the page
later on... When I open the page, it works perfectly, but when I
trigger the function to load other content, the div "y" does not
show...

What am I doing wrong ?
Break it down to its smallest component.

During the onprogress event of your XMLHttpRequest object display the element via:

validElementReference.style.display = 'block';

When the onload event of your XMLHttpRequest objects fires, hide the element via:

validElementReference.style.display = 'none';

validElementReference either being a single element of an object collection or an object
as found by getElementById.

-Lost
Apr 4 '07 #2

Lupus wrote:
ajax = new AjaxHandler;
nt = ajax.send("ztbl_prestationlist.asp","");

y.style.display = "none";
z.style.display = "block";

z is the container div for the ajax content, and y is a "please wait
while loading"-div.
Hi,
Put the script that hides "please wait while loading"-div in the
function that process the result of XmlHttpRequest. If it is placed
right after ajax.send("ztbl_prestationlist.asp",""); then the div
hides as soon as request will be sent.

Apr 5 '07 #3

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

Similar topics

1
by: Agency | last post by:
I'm still working on the bpm counter. I need to have at least 2 displays that are not static. One would be a clock/running time and the other would should the current beat count. How would I...
5
by: David Greenwood | last post by:
I posted this under 'microsoft.public.sqlserver.client' but got no reply. Any help with this problem would be greatly appreciated --------------------- I developed a database under SQL Server...
13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
3
by: shreddie | last post by:
Could anyone assist with the following problem? I'm using JavaScript to hide/show table rows depending on the option selected in radio buttons. The script works fine in IE but in Firefox the...
2
by: s.chelliah | last post by:
We have an input field which allows the user to enter a string of (up to 62) ASCII printable characters. We have a need to allow the user to be able to specify any sequence of characters he/she...
2
by: ruby_bestcoder | last post by:
Hi Im having problem in firefox with display:none/block. I have essentially 3 li elements. In each element there are a few nested div:s. Clicking on one of the divs, makes another div to...
7
by: Janis | last post by:
I try to understand what could be the source of a problem with displaying and hiding rows of tables using display:block/none. I've read selfhtml but could not find any hint about that. Any...
15
by: cssExp | last post by:
hello, Rather than going on a wild explanation on what's the the problem, it'll be much quicker and easier if i let you look at it yourself, so I'll post my page source (actual contents taken out,...
10
by: dkyadav80 | last post by:
<html> /// here what shoud be java script for: ->when script run then not display all input text field only display selection field. ->when user select other value for institute only this...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.