473,788 Members | 3,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1595
Al wrote on 08 okt 2003 in comp.lang.javas cript:
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.s tyle.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.javas cript:
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.s tyle.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.javas cript:
Evertjan. wrote:
Al wrote on 08 okt 2003 in comp.lang.javas cript:
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.s tyle.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******** ************@19 4.109.133.29...
David Dorward wrote on 08 okt 2003 in comp.lang.javas cript:
Evertjan. wrote: <snip>
<body onload="mydiv.s tyle.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.javas cript:
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******** ************@19 4.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.writ e 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.javas cript:
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
105841
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: System.out.print((char)27 + "[2J");
8
15828
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: http://www.cgiscript.net // Use the script, just leave this message intact. // Download your FREE CGI/Perl Scripts today! // ( http://www.cgiscript.net/scripts.htm )
8
3467
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? Thanks! Private Declare Function CreateDC Lib "gdi32" Alias "CreateDCA" (ByVal lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As String, ByVal lpInitData As String) As Integer
6
5621
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
4271
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 in C. I was able to find C code that grabs the pointer to the array of screen pixels in memory for the OS X platform: PixMap pixMap; GetQDGlobalsScreenBits((BitMap*)&pixMap);
5
1534
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 that offers more screen resolutions than just 1024x768 anf 800x600? In retrospec my current laptop is set at 1024x768 and I've never changed it but I don't want to box myself in with a machine that does just the 1024x768 anf 800x600 resolutions if...
10
1749
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 control codes? Are those standard across most platforms? Or is that just for PC/MAC based computers? Anyone know where I can see a list of ANSI codes? Please enlighten me, thanks for your time.
31
4205
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 - each of which is slammed by the next people along in the thread. So I'm afraid to ask this but I need to know!...
4
1510
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 better place. Over the past few months, I have been tracking stats on our website - http://www.ucancap.org - and find that less than 10% of our viewers use a screen resolution lower than 1024x768. My question is this: Is there a generally accepted...
0
9655
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.