By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,968 Members | 1,681 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,968 IT Pros & Developers. It's quick & easy.

Page Loading

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.