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

Page Loading

Hello,
I am having trouble creating a script to display a window while the
page is loading. I was wondering what the best way to do this would be.

Thank you,
Chaz

Dec 1 '06 #1
4 1664
uoL
Hello,
I have the same problem too. I tried displaying a div, something like
gmail does, but it doesn't work properly. It has some delay impossible
to make dissapear.
The code it's something like

show div
httpxmlrequest
hide div

but the result is:
first, the browser freezes for a second
second the content is displayed
third the div is displayed
fourth the div dissapear

when the logical thing to happen should be:

div is displayed
the browser freezes for a second
the content is displayed
the div dissapear.

Thanks


Yaotzin ha escrito:
Hello,
I am having trouble creating a script to display a window while the
page is loading. I was wondering what the best way to do this would be.

Thank you,
Chaz
Dec 4 '06 #2
uoL <wm*****@gmail.comwrote:
The code it's something like
show div
httpxmlrequest
hide div
but the result is:
first, the browser freezes for a second
second the content is displayed
third the div is displayed
fourth the div dissapear

when the logical thing to happen should be:

div is displayed
the browser freezes for a second
the content is displayed
the div dissapear.
I don't know how you initialize the page. Usually, I add a function for
for body on load and control everything in this on load function. For
example, put your httpxmlrequest in on load function, once finish this
request, go to a callback function for display content and then control
the div to be hidden.

Use this way should be ok.

--
Ming-Chin Chen
Dec 4 '06 #3
uoL
Hello,
Yes that does work but, what I want to do is that functionality for
display that warning for asyncronic content not only in the onload
event, for example an

<a href="javascript:;" onclick="putnewcontent();"go </a>

<script>
funtion putnewcontent ()
{
showloading();
xmlhttprequest();
hideloading();
}
</script>

something like that, as gmail might do.
but that code does not execute in order like I thought, I think it
might have something to do with the xmlhttprequest priority execution
or something like that.
If you are able to, test it. It might not happen to you,if you do so
please let me know.

Thanks

On 4 dic, 12:52, mingchin...@gmail.com wrote:
uoL <wmar...@gmail.comwrote:
The code it's something like
show div
httpxmlrequest
hide div
but the result is:
first, the browser freezes for a second
second the content is displayed
third the div is displayed
fourth the div dissapear
when the logical thing to happen should be:
div is displayed
the browser freezes for a second
the content is displayed
the div dissapear.I don't know how you initialize the page. Usually, I add a function for
for body on load and control everything in this on load function. For
example, put your httpxmlrequest in on load function, once finish this
request, go to a callback function for display content and then control
the div to be hidden.

Use this way should be ok.

--
Ming-Chin Chen
Dec 6 '06 #4
Hi,

As I mentioned, put the hide div function after execute xmlhttprequest.
For example change your code to

<script>
funtion putnewcontent ()
{
showloading();
xmlhttprequest();
}

function xmlhttprequest()
{
blah blah...
hideloading();
}
</script>

The problem is time gap between browser send request to server and
return value back to page.

I'm not sure how gmail working although I use it. :-P

--
Ming-Chin Chen

uoL <wm*****@gmail.comwrote:
Hello,
Yes that does work but, what I want to do is that functionality for
display that warning for asyncronic content not only in the onload
event, for example an

<a href="javascript:;" onclick="putnewcontent();"go </a>

<script>
funtion putnewcontent ()
{
showloading();
xmlhttprequest();
hideloading();
}
</script>

something like that, as gmail might do.
but that code does not execute in order like I thought, I think it
might have something to do with the xmlhttprequest priority execution
or something like that.
If you are able to, test it. It might not happen to you,if you do so
please let me know.
Dec 7 '06 #5

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

Similar topics

1
by: BKM | last post by:
I've been using the following 2 ways to make sure my WebBrowser is finished loading a page before continuing with the next code. do:doevents:loop while WebBrowser.Busy do:doevents:loop until...
2
by: Patrick Olurotimi Ige | last post by:
Is it possible to execute a query or do some validation before loading a page.. I have a survey page and i want to validate users before loading the page. I have done it in the page_load. But...
5
by: Peter Rilling | last post by:
I have an interesting issues that, although I not blocking me, is not very performance. Maybe someone can suggest a better way of doing this. 1) I have a page that displays a grid with command...
7
by: UJ | last post by:
I've got a page with a user control on it. While the page is loading, it needs to check certain conditions of the user object to enable/disable things on the screen. Currently in the page_load of...
1
by: John Smith | last post by:
Hey folks, Got a weird one for you that I think may just be a bug with Internet Explorer. I have a page that hosts an IFrame. When I call Javascript in my page to change the source of the...
1
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the...
8
by: Radx | last post by:
Here in my web application, I have a data entry page with serval controls. Some of the controls have autopostback is set true. But the problem is when two or more people are entering data at the...
4
by: Tim | last post by:
Hello, I have a web page that a user enters in information and selects some products. On submit the page the info is saved to a db, connects to third party web apps and retrieves data, and...
3
by: The alMIGHTY N | last post by:
I have an XSL file that works with a typically large XML data set generated dynamically from a database. This data is written to the HTML result as a deep multi-dimensional array that is used by...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.