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

Render a DIV while loading

Hi there!!! I'm wondering what I've did wrong here... I try to do a
gmail-like "loading" red square at top right...

Here is my code:
<div id=loading
style=display:none;background-color:#FF0000;position:absolute;right:0px;top:0px> <b><font
color=white><p
style=text-decoration:blink;>Loading</p></b></font></div>

the javascript i have is like this one:

<script>
document.all("loading").style.display = '';
[some processing that takes CPU]
document.all("loading").style.display = 'none';
</script>

When I run this code, it seems to "freeze" the browser thought not
showing the little loading square as it should while processing... If
there anything like document.all("loading").render ???

Thanks!

Aug 16 '06 #1
3 6237

ma******@gmail.com wrote:
<script>
Type attribute is required, though by default browsers will typically
fallback to javascript.

<script type = "text/javascript">
document.all("loading").style.display = '';
[some processing that takes CPU]
document.all("loading").style.display = 'none';
</script>
I would say try to avoid the use of document.all. Introduced in IE4,
you could say it's a propietary property though some browsers do
support it. Using document.getElementById method is more widely
supported.

The main problem with your code statement is that you're trying to
show/hide your "loading" message all in one execution. Break them out
into separate functions and you should be fine. For example:

....
toggleLoading();
[your CPU intensive process]
toggleLoading();
....
When I run this code, it seems to "freeze" the browser thought not
showing the little loading square as it should while processing... If
there anything like document.all("loading").render ???
There is no render property.

Aug 16 '06 #2
Hi, thanks for answering me,

I've tried the "split toggle loading message" into a function like you
suggest but it produce the same result...

now it's like that

<script type="text/javascript">
toggle_load('');
some cpu thing
toggle_load('none')
</script>

web.dev wrote:
ma******@gmail.com wrote:
<script>

Type attribute is required, though by default browsers will typically
fallback to javascript.

<script type = "text/javascript">
document.all("loading").style.display = '';
[some processing that takes CPU]
document.all("loading").style.display = 'none';
</script>

I would say try to avoid the use of document.all. Introduced in IE4,
you could say it's a propietary property though some browsers do
support it. Using document.getElementById method is more widely
supported.

The main problem with your code statement is that you're trying to
show/hide your "loading" message all in one execution. Break them out
into separate functions and you should be fine. For example:

...
toggleLoading();
[your CPU intensive process]
toggleLoading();
...
When I run this code, it seems to "freeze" the browser thought not
showing the little loading square as it should while processing... If
there anything like document.all("loading").render ???

There is no render property.
Aug 16 '06 #3
ma******@gmail.com writes:
Hi, thanks for answering me,

I've tried the "split toggle loading message" into a function like you
suggest but it produce the same result...

now it's like that

<script type="text/javascript">
toggle_load('');
some cpu thing
toggle_load('none')
</script>
Hi,

What you probably want is:

<script type="text/javascript">
toggle_load ('');
</script>

<script type="text/javascript">
cpu_intensive_thing ();
</script>

<script type="text/javascript">
toggle_load ('none');
</script>
Hope this helps.

A.

Aug 17 '06 #4

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

Similar topics

0
by: Buddy Ackerman | last post by:
I have a page where users upload files. I have the maxRequestLength set and have created a Page_Error procedure to trap the error when someone load a file that is larger than the maxRequestLength. ...
4
by: Brian Watkins | last post by:
Hello All, I have a a file display page that contains two frames. In the left frame is a tree view that lists a directory and all its subfolders. Each node in the left frames tree is a link...
2
by: Andrea Williams | last post by:
I have a form where the user chooses reporting options and when submit is clicked, I need to present them with dynamically created excel file. In Classic ASP I would just change the viewing...
1
by: Henri | last post by:
I guess I could do that with an .ascx UserControl file using Page.LoadControl(), but as I want to render a complete page inside a mail body, loading an .aspx might be nicer... Any suggestion? ...
1
by: john | last post by:
Hi I'm suddenly having a problem running ASP.Net apps from an XP Pro laptop machine which was working fine. The apps now just time out will not render anything in the Browser. I have...
5
by: Piotr Strycharz | last post by:
Hi I want to render a page in memory. That is (pseudo-code): Page aPage = new Page(); LiteralControl lc = new LiteralControl("<form runat=server><asp:Label id=label Runat=server/>...");...
1
by: Kevin R | last post by:
This is one of the weirdest problems I have ever run into. I have had to trim down a bunch of code to give a sample that is more easily readable by those who will view this. Here is the problem:...
7
by: SteveM | last post by:
I am sure this is an easy question, but being relatively new to ASP.NET programming, I can not quite grasp what I need to accomplish what I need to do. What I have is a word document that is...
3
by: docbook.xml | last post by:
I am using a waitPreLoadPage script that displays a "Loading ... Please wait" splash screen while the page is loading. See: < http://www.quantumcrypto.de/ > Safari renders everything, but the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.