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

pre-loading a script

Guys,

I resorted to wysiwyg software to write a fancy JS nav bar and I've hidden
an equivalent static HTML set underneath it for disabled browsers.

My problem is; I cant get the appearance of JS and HTML versions to match
pixel-perfect, so as the JS loads a split second late you get a double load
jerk effect.

How can I get the src= linked script to appear before the HTML hidden under
it?

Thanks for any pointers,

---dE|_---
Mar 15 '08 #1
4 1287
On Mar 15, 11:54 am, "dE|_" <dee-e-...@crackguitar.comwrote:
Guys,

I resorted to wysiwyg software to write a fancy JS nav bar and I've hidden
an equivalent static HTML set underneath it for disabled browsers.

My problem is; I cant get the appearance of JS and HTML versions to match
pixel-perfect, so as the JS loads a split second late you get a double load
jerk effect.

How can I get the src= linked script to appear before the HTML hidden under
it?
I recently explored some "jerk" problems and cross-browser loading.

<URL: http://peter.michaux.ca/article/7217>

Peter
Mar 15 '08 #2
On Mar 16, 9:26 am, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
Peter Michaux wrote:
I recently explored some "jerk" problems and cross-browser loading.
<URL:http://peter.michaux.ca/article/7217>

One of these "jerk problems" that you miss is that some people keep
advocating to use only the proprietary, inherently unreliable
`window.onload' property
I feature tested for addEventListener and attachEvent on the global
object.
while there are standards-compliant, reliable
alternatives.
What? The body onload attribute?

Peter
Mar 16 '08 #3
On Mar 16, 12:52 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
Peter Michaux wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
Peter Michaux wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
Peter Michaux wrote:
I recently explored some "jerk" problems and cross-browser loading.
<URL:http://peter.michaux.ca/article/7217>
One of these "jerk problems" that you miss is that some people keep
advocating to use only the proprietary, inherently unreliable
`window.onload' property
I feature tested for addEventListener and attachEvent on the global
object.
That is only as error-prone.
Why?

Because the Global Object is a native object, not a DOM host object. It
does not need to implement the EventTarget interface of W3C DOM Level 2+
Events or another API.
I'm not so hung up about standardized DOM objects vs non-standard
objects. I use XMLHttpRequest objects based on feature tests. If I
feature test that the global object has addEventListener then it is a
reasonably safe bet the global object will support the onload event.

You should forego attachEvent()
And do what for IE?

Either window.onload or (better) the `onload' attribute of the `body' element.
Well if I was doing that for IE then I would probably just do that for
all browsers.

I've seen in your libray code (http://pointedears.de/scripts/dhtml.js)
that you don't use attachEvent but the reason sited in the comments
did not seem compelling. In the following page which you site

http://www.quirksmode.org/blog/archi...nt_consid.html

PPK seems quite excited about the fact that the "this" keyword doesn't
work the same in the event handlers for IE and W3C. This may have been
an issue when PPK wrote the article but it is no longer considered an
insurmountable challenge for an event library to correct.

[snip]

Peter
Mar 16 '08 #4
On Sun, 16 Mar 2008 14:42:18 -0700, VK wrote:
Well, if you have a script-generated menu and a static fall-back menu
then the most obvious solution would be to use <script><noscript>
blocks:
Alas, I've found noscript to be fragile.

One of my Javascript stopper plugins under Firefox will keep JS from
running, but won't parse noscript blocks, leaving the user with nothing.

In addition, some firewalls/proxies will strip out Javascript, even
though the browser itself has JS support turned on. Again, the noscript
block will not render.
Mar 17 '08 #5

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

Similar topics

21
by: Headless | last post by:
I've marked up song lyrics with the <pre> tag because it seems the most appropriate type of markup for the type of data. This results in inefficient use of horizontal space due to UA's default...
3
Pre
by: Neal | last post by:
A few questions about pre... When presenting preformatted text using the white-space: pre; property/value, Opera renders long lines at small viewport widths as exiting the borders of the...
7
by: Alan Illeman | last post by:
How do I set several different properties for PRE in a CSS stylesheet, rather than resorting to this: <BODY> <PRE STYLE="font-family:monospace; font-size:0.95em; width:40%; border:red 2px...
2
by: Buck Turgidson | last post by:
I want to have a css with 2 PRE styles, one bold with large font, and another non-bold and smaller font. I am new to CSS (and not exactly an expert in HTML, for that matter). Is there a way to...
5
by: Porthos | last post by:
I'm authoring an XML document and using the <pre> html tag for the portions that are not dynamically generated. The <pre> text is displaying in a smaller font size (and I believe different font)...
5
by: Michael Shell | last post by:
Greetings, Consider the XHTML document attached at the end of this post. When viewed under Firefox 1.0.5 on Linux, highlighting and pasting (into a text editor) the <pre> tag listing will...
8
by: Jarno Suni not | last post by:
It seems to be invalid in HTML 4.01, but valid in XHTML 1.0. Why is there the difference? Can that pose a problem when such a XHTML document is served as text/html?
7
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no...
23
by: Xah Lee | last post by:
The Concepts and Confusions of Pre-fix, In-fix, Post-fix and Fully Functional Notations Xah Lee, 2006-03-15 Let me summarize: The LISP notation, is a functional notation, and is not a...
14
by: Schraalhans Keukenmeester | last post by:
I am building a default sheet for my linux-related pages. Since many linux users still rely on/prefer viewing textmode and unstyled content I try to stick to the correct html tags to pertain good...
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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.