Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > message

Reply
Thread Tools

message

 
 
mike
Guest
Posts: n/a
 
      12-05-2005
I have a page that generates content in a <tbody></tbody> dynamically.

The thing is if there is about 167 or so records it takes some time to
render them so I put a tag like:

<div id="str_status"> </div>

and in my js I have

function blah()
{
document.getElementById("srt_status").innerHTML = "rendering";
..
..
..some code here that takes a bit of time
..
..
document.getElementById("srt_status").innerHTML = "";
}

Problem is I never see the "rendering" ..... Looks like it renders all
at once and is not updating as the steps occur.

Any thoughts?

Mike

 
Reply With Quote
 
 
 
 
Ivo
Guest
Posts: n/a
 
      12-05-2005
"mike" wrote
> I have a page that generates content in a <tbody></tbody> dynamically.
> The thing is if there is about 167 or so records it takes some time to
> render them so (...) in my js I have
>
> function blah()
> {
> document.getElementById("srt_status").innerHTML = "rendering";
> .
> .some code here that takes a bit of time
> .
> document.getElementById("srt_status").innerHTML = "";
> }
>
> Problem is I never see the "rendering" ..... Looks like it renders all
> at once and is not updating as the steps occur.


That 's right. And in the main we 're only glad that no time in between is
wasted on useless redrawings. To tell the machine that you 're looking for
such intermediate update, you could employ a setTimeout:

function blah()
{
document.getElementById("srt_status").innerHTML = "rendering";
window.setTimeout( 'proceed();', 10 );
}

function proceed()
{
..
..some code here that takes a bit of time
..
document.getElementById("srt_status").innerHTML = "";
}

The minimum amount of waiting time (10 ms. in the code above) needed for the
effect to succeed, varies from machine to machine. I have found that a
Timeout of 1 ms is too short in some situations, but 50 or 100 is much more
than enough.
hth
ivo
http://4umi.com/



 
Reply With Quote
 
 
 
 
Danny
Guest
Posts: n/a
 
      12-06-2005

Roughly knowing little of what you have, I'd say is some runtime
issue, some process might be overriding the "rendering" part or
conflicting it, OR is just your timing doesn't allow for a screen
painting of the text long enough to be viewable.



Danny
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Thunderbird - message exceeds the Maximum Message Size? Gerry Firefox 0 02-18-2005 06:39 PM
Error message different than Context.Server.GetLastError.Message tshad ASP .Net 0 01-27-2005 06:38 PM
New OWA message and Modify body of Message - Steve - ASP .Net 0 07-06-2004 04:54 AM
Size of e-mail message - message.Body = msgText =?Utf-8?B?bWc=?= ASP .Net 1 02-11-2004 07:42 PM
Combining message.BodyFormat = MailFormat.Html & message.BodyFormat = MailFormat.Text =?Utf-8?B?bWc=?= ASP .Net 1 02-08-2004 10:43 PM



Advertisments