Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > <FAQENTRY>I'm changing my page but nothing is changing on the screen. Why?</FAQENTRY>

Reply
Thread Tools

<FAQENTRY>I'm changing my page but nothing is changing on the screen. Why?</FAQENTRY>

 
 
VK
Guest
Posts: n/a
 
      03-13-2007
As per discussion in the thread
http://groups.google.com/group/comp....7e4f3a30f4d1c3
I'm proposing to add new FAQ entry:

----------------------------------------------------------------
I'm changing my page but nothing is changing on the screen. Why?
----------------------------------------------------------------

You may be experiencing the repaint delay problem. All existing
browsers do not update graphics context (screen content) until after
the current execution is finished. Until it's finished the DOM changes
are being accumulated but not reflected on the screen. The most
commonly used way to overcome this problem is by using micro-breaks
over setTimeout.

/* repaint delay vulnerable coding : */
function someLongProcess() {
document.getElementById('LoadingMessage').style.vi sibility =
'visible';
doLongProcess();
document.getElementById('LoadingMessage').style.vi sibility =
'hidden';
}

In the sample above nothing will work as the coder would expect.
LoadingMessage DOM element will remain invisible on the screen until
after someLongProcess function is fully executed. Only after that all
graphics context changes will be applied in one bulk, so
LoadingMessage element will be changed to visible and to hidden right
after that, so for the viewer it will not appear at all.

/* repaint delay aware coding : */
function someLongProcess() {
document.getElementById('LoadingMessage').style.vi sibility =
'visible';
window.setTimeout(doLongProcess, 60);
}

function doLongProcess() {
// long process;
document.getElementById('LoadingMessage').style.vi sibility =
'hidden';
}

----------------------------------------------------------------

Some notes to the FAQ text:
1) I'm struggling to find the right term for "the current execution is
finished". It is not really finished - that can be a few processes
over setInterval for instance. "current thread" or "current flaw" is
bad IMHO as well as because of terminology confusion (JavaScript
doesn't implement threaded model). Ideas?

2) This issue is really a "bug qualifying feature" - it forces to use
modularity based not on the programming logic but on graphics engine
weakness. So I think to file a feature request to Bugzilla based on
this FAQ. It doesn't matter that "everyone does the same" - some day a
UA should appear that does it not.

3) If anyone has timŐ it would be interesting to check if the "soft
break" would works, so something like:

function someLongProcess() {

window.setTimeout("document.getElementById('Loadin gMessage').style.visibility
= 'visible';", 60);
doLongProcess();
document.getElementById('LoadingMessage').style.vi sibility =
'hidden';
}

I can tell pretty sure that it will fail for synchronious XHR calls
where the suggested "hard break" is the only option. But maybe for
some other cases like the one in the thread I linked?


P.S. Yeah, I know... Started laud on rounding FAQ and ended up will
all another unrelated FAQ. The problem with the rounding FAQ is that
it is now in E=mc^2 state. I don't mean it's so genius I mean that
while the suggestion itself is short and simple, the explanation and
proof of "why?" requires a whole big article I have to write first.
But this FAQ is still in my schedule.

 
Reply With Quote
 
 
 
 
VK
Guest
Posts: n/a
 
      03-14-2007
On Mar 13, 7:09 pm, "VK" <(E-Mail Removed)> wrote:
> As per discussion in the threadhttp://groups.google.com/group/comp.lang.javascript/browse_frm/thread...
> I'm proposing to add new FAQ entry:
>
> ----------------------------------------------------------------
> I'm changing my page but nothing is changing on the screen. Why?
> ----------------------------------------------------------------


Any comments or is it accepted as it is?

 
Reply With Quote
 
 
 
 
Richard Cornford
Guest
Posts: n/a
 
      03-14-2007
VK <(E-Mail Removed)> wrote
> On Mar 13, 7:09 pm, VK wrote:

<snip>
>> I'm proposing to add new FAQ entry:

<snip>
> Any comments or is it accepted as it is?


Why do you think an assertion of yours about your own intentions needs
acceptance (or, presumably, rejection)?

Richard.

 
Reply With Quote
 
Dr J R Stockton
Guest
Posts: n/a
 
      03-15-2007
In comp.lang.javascript message <et9njv$phl$1$(E-Mail Removed)>
, Wed, 14 Mar 2007 20:57:38, Richard Cornford
<(E-Mail Removed)> posted:
>VK <(E-Mail Removed)> wrote
>> On Mar 13, 7:09 pm, VK wrote:

><snip>
>>> I'm proposing to add new FAQ entry:

><snip>
>> Any comments or is it accepted as it is?

>
>Why do you think an assertion of yours about your own intentions needs
>acceptance (or, presumably, rejection)?



It is presumptuous for a failed FAQ maintainer to criticise the efforts
of one who is undoubtedly active.

VK's efforts can be judged easily enough by appearances and general
response3s - there is no need for you to do a general public vendetta.

--
(c) John Stockton, Surrey, UK. REPLYyyww merlyn demon co uk Turnpike 6.05.
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demon.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes precede replies. Snip well. Write clearly. Mail no News.
 
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
re module: Nothing to repeat, but no sre_constants.error: nothing torepeat ? Devin Jeanpierre Python 2 02-14-2012 01:33 PM
I know nothing about Java but is this possible Pete Java 2 03-09-2006 07:36 AM
HttpURLConnection - works with '.html' but nothing else, why? junk1@davidbevan.co.uk Java 1 03-07-2006 02:29 AM
SQLConnection.Open() Timeout Error - but...nothing has changed? Nevyn Twyll ASP .Net 4 03-19-2005 01:38 AM
Problem in executing a script on the server side ! Script found but nothing executed ! Cédric Rossé ASP .Net 1 11-09-2004 09:43 AM



Advertisments