Re: Newbie Question on the Basics
- From: David Golightly <davigoli@xxxxxxxxx>
- Date: Sat, 18 Aug 2007 19:56:13 -0000
On Aug 17, 5:06 pm, Thomas 'PointedEars' Lahn <PointedE...@xxxxxx>
wrote:
David Golightly wrote:
On Aug 17, 12:00 pm, Vik Rubenfeld <v...@xxxxxxxxxxxxxxxxxxxxxx>
wrote:
1) I don't see anything in the HTML that calls the JavaScript. What is
it in the HTML that calls the Javascript?
2) Autocomplete has to work by calling a function after every keypress.
What is it in the HTML that calls the Javascript after every keypress?
You're looking at an example of "unobtrusive scripting". The idea
here is that the HTML doesn't have to call the JavaScript - the JS is
perfectly capable of initializing itself. The "window.onload" sets
the window's "onload" property to a function that gets called when the
"load" event is fired, typically when the browser is done loading and
rendering the page and any dependent files (images, etc.). The
"onload" function then uses the DOM to locate nodes in the document
and, again using the DOM, attach event handlers to them, including
"onkeypress". This is a newer and not yet ubiquitous technique,
In fact, it is based on an now-obsolete approach, originating from Netscape 2.0.
and while some feel that it's controversial (which, I suppose, makes it
controversial, no?), is generally accepted as a best practice for
making pages that degrade gracefully
It is not at all a means of graceful degradation.
This isn't an argument. It's just contradiction! (--Monty Python)
.
- Follow-Ups:
- Re: Newbie Question on the Basics
- From: Thomas 'PointedEars' Lahn
- Re: Newbie Question on the Basics
- References:
- Newbie Question on the Basics
- From: Vik Rubenfeld
- Re: Newbie Question on the Basics
- From: David Golightly
- Re: Newbie Question on the Basics
- From: Thomas 'PointedEars' Lahn
- Newbie Question on the Basics
- Prev by Date: Move object with a for loop
- Next by Date: Re: Newbie Question on the Basics
- Previous by thread: Re: Newbie Question on the Basics
- Next by thread: Re: Newbie Question on the Basics
- Index(es):
Relevant Pages
|
Loading