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

Screen question

Al
Hi,

Can I turn on/off the browser's screen updating until the entire page is
loaded ? i.e. is it possible to show a page only when it is completely in
browser's memory ? I don't want to show a object one by one when downloading
a page.

thanks in advance

Jul 20 '05 #1
7 1579
Al wrote on 08 okt 2003 in comp.lang.javascript:
Can I turn on/off the browser's screen updating until the entire page
is loaded ? i.e. is it possible to show a page only when it is
completely in browser's memory ? I don't want to show a object one by
one when downloading a page.

<body onload="mydiv.style.display=''">
<div id="mydiv" style="display:none;">
===<br>
===<br>
===<br>
===<br>
===<br>
All contents of the page here<br>
===<br>
===<br>
===<br>
===<br>
===
</div>
</body>

===================

onload=.. really means "on page loaded"

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2
Evertjan. wrote:
Al wrote on 08 okt 2003 in comp.lang.javascript:
Can I turn on/off the browser's screen updating until the entire page
is loaded ? i.e. is it possible to show a page only when it is
completely in browser's memory ? I don't want to show a object one by
one when downloading a page.

<body onload="mydiv.style.display=''">
<div id="mydiv" style="display:none;">


This is two side effects...

(1) If the user doesn't have JavaScript enabled, but does have CSS enabled,
they won't see the content - ever.

(2) If the user doesn't happen to be using a browser with the non-standard
"all ids automatically become global variables" thing, they will again, see
nothing.

--
David Dorward http://dorward.me.uk/
Jul 20 '05 #3
David Dorward wrote on 08 okt 2003 in comp.lang.javascript:
Evertjan. wrote:
Al wrote on 08 okt 2003 in comp.lang.javascript:
Can I turn on/off the browser's screen updating until the entire
page is loaded ? i.e. is it possible to show a page only when it is
completely in browser's memory ? I don't want to show a object one
by one when downloading a page.

<body onload="mydiv.style.display=''">
<div id="mydiv" style="display:none;">


This is two side effects...

(1) If the user doesn't have JavaScript enabled, but does have CSS
enabled, they won't see the content - ever.


I think you should see my code as a pointer in the right direction.
Of cource you can improve on it by also hiding the div by javascript in
the <head> section.
(2) If the user doesn't happen to be using a browser with the
non-standard "all ids automatically become global variables" thing,
they will again, see nothing.


Personally I always use getElementById.

Again, I think code given in this NG should be NOT used "copy, paste and
no need to understand", but just showing that it can be done.

==============

Furthermore it is the personal choice of the page builder, if he wants to
accommodate for non-IE browsers and for javascript off. [Or only for NS,
for that matter] That does not mean I think it a bad thing that you warn
for these matters in my code. You are welcome to do that.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #4
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
David Dorward wrote on 08 okt 2003 in comp.lang.javascript:
Evertjan. wrote: <snip>
<body onload="mydiv.style.display=''">
<div id="mydiv" style="display:none;">
This is two side effects...

(1) If the user doesn't have JavaScript enabled, but does
have CSS enabled, they won't see the content - ever.


I think you should see my code as a pointer in the
right direction.


That assumes it is the right direction. The OP's problem seems to be the
progressive rendering of HTML so there might be HTML structures that
could be used on the page that would prevent the browser from doing
progressive rendering. That would of course be a question best addressed
to an HTML group but if it can be done then the JavaScript dependency
would become totally avoidable.
Of cource you can improve on it by also hiding the
div by javascript in the <head> section.
Except that it is not quite as simple as just using JavaScript to
document.write a style element in to the head section as some browsers,
even with JavaScript enables, just cannot switch the CSS display
property of an element with JavaScript so the browser's support for that
ability would have to be ascertained prior to the writing of the style
element. (and directly setting style.display = 'none'; in the head won't
work because the DIV would not exist at that point).
(2) If the user doesn't happen to be using a browser
with the non-standard "all ids automatically become
global variables" thing, they will again, see nothing.


Personally I always use getElementById.


Then why do you frequently post code that assumes IDs will be global
properties?
Again, I think code given in this NG should be NOT used
"copy, paste and no need to understand",
There is considerably more to Internet browser scripting than just
writing code, so providing copy-n-paste code without explanation would
be doing nobody any favours. If posted code has issues then it has got
to be worth mentioning them.
but just showing that it can be done.
Consider the not infrequently enquired about desire to read and write
files on the user's computer over the Internet. It can be done and the
code to do it could be posted, but there are so many ifs associated with
attempting to do it that in practice it is impractical.

There is a big difference between what can be done and what should be
done, especially when what can be done can only be done on one browser
in a very specific configuration.
Furthermore it is the personal choice of the page builder,
if he wants to accommodate for non-IE browsers and for
javascript off. [Or only for NS, for that matter] That
does not mean I think it a bad thing that you warn for
these matters in my code. You are welcome to do that.


It should not really be necessary for other people to be pointing out
issues with your code. But because you author exclusively for JScript
enabled default configurations of IE running on default configurations
of Windows OSs and don't even consider the alternative, you are just
unaware of most of the issues associated with the code you post to this
group.

Obviously that is your decision but as the default assumption for this
group is that questions asked relate to cross-browser scripting for the
Internet (unless stated otherwise, as noted in the FAQ) much higher
standards than yours are expected here.

Of course the simplest solution would be for you to add the caveat that
to the best of your knowledge all the code you post will only work
successfully on JScript enabled default configurations of Windows IE (or
whatever more specific warning best describes your situation), and leave
it to the OP (and others) to judge what value to place on the
accompanying contribution for themselves.

Richard.
Jul 20 '05 #5
Richard Cornford wrote on 09 okt 2003 in comp.lang.javascript:
Of cource you can improve on it by also hiding the
div by javascript in the <head> section.
Except that it is not quite as simple as just using JavaScript to
document.write a style element in to the head section as some
browsers, even with JavaScript enables, just cannot switch the CSS
display property of an element with JavaScript so the browser's
support for that ability would have to be ascertained prior to the
writing of the style element. (and directly setting style.display =
'none'; in the head won't work because the DIV would not exist at that
point).


You are right there, I did not think of that.
Personally I always use getElementById.


Then why do you frequently post code that assumes IDs will be global
properties?


Because I am lazy and want to get to the point quickly.
Perhaps your response will cure me.
Again, I think code given in this NG should be NOT used
"copy, paste and no need to understand",


There is considerably more to Internet browser scripting than just
writing code, so providing copy-n-paste code without explanation would
be doing nobody any favours. If posted code has issues then it has got
to be worth mentioning them.


Here we agree.
Furthermore it is the personal choice of the page builder,
if he wants to accommodate for non-IE browsers and for
javascript off. [Or only for NS, for that matter] That
does not mean I think it a bad thing that you warn for
these matters in my code. You are welcome to do that.


It should not really be necessary for other people to be pointing out
issues with your code. But because you author exclusively for JScript
enabled default configurations of IE running on default configurations
of Windows OSs and don't even consider the alternative, you are just
unaware of most of the issues associated with the code you post to
this group.


What I code for some of my own pages is not the same as what I show in
this NG. But even so many how-to issues are far more interesting than the
finesses of cross browser or cross version relyability.
Obviously that is your decision but as the default assumption for this
group is that questions asked relate to cross-browser scripting for
the Internet (unless stated otherwise, as noted in the FAQ) much
higher standards than yours are expected here.

Of course the simplest solution would be for you to add the caveat
that to the best of your knowledge all the code you post will only
work successfully on JScript enabled default configurations of Windows
IE (or whatever more specific warning best describes your situation),
and leave it to the OP (and others) to judge what value to place on
the accompanying contribution for themselves.


I try not to post jscript specific code in this NG, but do not expect me
to have my examples cross platform tested. Usually I try to add "IE6
tested".

And please do not expect me to be an expert. I get far more from this NG
than I give.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #6
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Of cource you can improve on it by also hiding the
div by javascript in the <head> section.
Except that it is not quite as simple as just using JavaScript to
document.write a style element in to the head section as some
browsers, even with JavaScript enables, just cannot switch the CSS
display property of an element with JavaScript so the browser's
support for that ability would have to be ascertained prior to the
writing of the style element. (and directly setting style.display =
'none'; in the head won't work because the DIV would not exist
at that point).


You are right there, I did not think of that.


There does appear to be a correlation between - typeof x.style.display
== 'string' - and a browser's ability to dynamically switch the display
state of an element. But the style.display property of the DIV would
still not exist at this point so to test within the head it would be
necessary to test the style.display property of an element that did
exist at that point, such as the title, or the script element itself.
Fortunately, the browsers on which you cannot access the head elements
(or don't have style objects on elements) also cannot switch the display
state of an element, so a positive - typeof x.style.display ==
'string' - might be used to justify writing out a new style element
with - #mydiv { display:none; } - or similar.

That would clearly be code that made and inference based on an
assumption, not something that should be done in cross-browser scripting
without a very good reason.

Thinking more about the OP's problem, I wonder if it doesn’t actually
come down to an inefficient server script, dribbling HTML into the
response while it does a lot of complex work (database references and
calculation). In which case the real solution might be to do all the
complex work and pre-building the HTML (or critical sections of it)
before starting to output anything, so the response would be an
uninterrupted stream of HTML. In which case it probably would not be too
important if the browser progressively rendered it as it arrived, even
if it was a large page, as the user would probably still not have time
to read the first screen full before the download and rendering was
finished.

Another case where knowing why something was wanted (including details
of the context) may have suggested other approaches that would avoid any
JavaScript dependency.

<snip>... . Usually I try to add "IE6 tested".

<snip>

Add the work "only" and you probably will never get comments about code
not being cross-browser. But still maybe suggestions about making it
more cross-browser, cleaner degrading, reliable and/or more general.

Richard.
Jul 20 '05 #7
Richard Cornford wrote on 10 okt 2003 in comp.lang.javascript:
Another case where knowing why something was wanted (including details
of the context) may have suggested other approaches that would avoid any
JavaScript dependency.


Context is everything.

Then again, just a clientsided javascript answer is not uncommon or
illogical in this NG.

;-}

Many a problem can better be delt with serverside, making the cross browser
issue a minor issue. But telling this to a OP that potentially has no
serverside code access could be quite rude.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #8

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

Similar topics

19
by: Dave | last post by:
Hi, I have done some research, trying to Clear The Screen in java code. The first option was the obv: system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n"); then i heard about this method:...
8
by: Els | last post by:
Hi, i have the following script in the head of my document: <script language="Javascript"> <!-- // *********************************************** // AUTHOR: WWW.CGISCRIPT.NET, LLC // URL:...
8
by: gregory_may | last post by:
Is there a way to grab a "Screen Shot" that includes "Tool Tips"? I saw this code someplace, cant remember where. But it doesnt grab "Tool Tips". Is there a better way to do this in .net?...
6
by: Tony Liu | last post by:
Hi, when switched to the full screen mode in VS.NET IDE, is there any way to hide the main menu bar? Thanks Tony
7
by: alr288 | last post by:
Hello All, I recognize that this question has already brought about some debate so I am going to ask as a specific question as I can. I am currently try to create a cross platfrom screen parser...
5
by: TD | last post by:
This question is off topic but you folks have the answers. I do Access development work at clients offices using my laptop. I want to purchase a new laptop but I am wondering if I need a laptop...
10
by: Kenneth Lantrip | last post by:
My question is: Is there a generally accepted way to clear the screen and perhaps move the cursor to a new location (other than newline) for the next printf in standard c? What about ANSI...
31
by: melinama | last post by:
Hello, I've looked through alt.html and this group for an answer to my question. However, I found only cranky arguments with, occasionally, bits of hard-to-understand code - out of context -...
4
by: Annalyzer | last post by:
Not sure if this is the right place to post this question because it is not specific to html or css and it's more of an opinion question than a technical one so feel free to move it if there is a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.