473,386 Members | 1,799 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.

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

VK
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.

Mar 13 '07 #1
4 1536
VK
On Mar 13, 7:09 pm, "VK" <schools_r...@yahoo.comwrote:
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?

Mar 14 '07 #2
VK <sc**********@yahoo.comwrote
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.

Mar 14 '07 #3
VK said the following on 3/14/2007 1:25 PM:
On Mar 13, 7:09 pm, "VK" <schools_r...@yahoo.comwrote:
>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?
Or is it that the people who might comment on it haven't had time? It is
so full of things that are incoherent that it's difficult to know where
to start. Rest assured, it is not "accepted as it is".

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 15 '07 #4
In comp.lang.javascript message <et*******************@news.demon.co.uk>
, Wed, 14 Mar 2007 20:57:38, Richard Cornford
<Ri*****@litotes.demon.co.ukposted:
>VK <sc**********@yahoo.comwrote
>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.
Mar 15 '07 #5

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

Similar topics

47
by: VK | last post by:
Or why I just did myArray = "Computers" but myArray.length is showing 0. What a hey? There is a new trend to treat arrays and hashes as they were some variations of the same thing. But they...
27
by: VK | last post by:
<http://www.jibbering.com/faq/#FAQ3_2> The parts where update, replacement or add-on is needed are in <update> tag. 3.2 What online resources are available? Javascript FAQ sites, please...
39
by: eruanion | last post by:
Hi, I've been working on this for a while now and I can't seem to find out what is wrong with my code. I have 2 files one c3common.js which only contains javascript functions for my main html page...
11
by: jesdynf | last post by:
I'm having trouble applying a stylesheet to content I'm generating after the fact. Here's the sample code: <html> <head> <title>CSS/DOM Problem Example</title> <style type="text/css">...
2
by: Nickolay Ponomarev | last post by:
http://www.jibbering.com/faq/#FAQ3_2 says: Please change this to just: The old reference on mozilla.org was very bad; we're trying to update it after having moved it into the MDC wiki. The zip...
19
by: VK | last post by:
http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/ b495b4898808fde0> is more than one month old - this may pose problem for posting over some news servers. This is why I'm...
49
$
by: google | last post by:
what dose a $ do in javascript, i have been given a bit of code and there are $'s all over the place, can someone explain their uses
6
by: =?iso-8859-2?Q?K=F8i=B9tof_=AEelechovski?= | last post by:
At <http://jibbering.com/faq/index.html#FAQ4_41> IS Microsoft introduced a shortcut that can be used to reference elements which include an ID attribute where the ID becomes a global variable....
31
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I modify the current browser window?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.