Re: Dynamic select lists using optgroups again - without frameworks



On Jan 21, 7:42 am, Thomas 'PointedEars' Lahn <PointedE...@xxxxxx>
wrote:
RobG wrote:
It has been mentioned here a number of times that you can achieve the
same effect as a "dom ready" function by inserting all your scripts
just before the closing </body> tab, then calling your initialising
function at the bottom of the last script element, or as the only code
in the last script element.

The DOM will be ready and you don't need to use window.onload (or
document.body or whatever) or DOM ready and it has the pleasant side
effect of loading the page faster.

However, the functionality of this approach is based on mere assumption,
much in contrast to the intrinsic `onload' event handler attribute.

Using onload is also based on the "mere assumption" that the UA
supports onload. If you feature detect for onload and find it's not
supported, what then?

I imagine that scenarios is about as common as finding that the DOM
isn't ready when the very last element is parsed.


--
Rob
.



Relevant Pages

  • Re: Dynamic select lists using optgroups again - without frameworks
    ... in the last script element. ... The DOM will be ready and you don't need to use window.onload (or ... Using onload is also based on the "mere assumption" that the UA ... at the time the feature was introduced, ...
    (comp.lang.javascript)
  • Re: DOMContentReady and focus() in Opera
    ... Have the onload listener check to see if the DOM ready ... using a script which did its setup in an onload handler. ...
    (comp.lang.javascript)
  • Re: Dynamic select lists using optgroups again - without frameworks
    ... just before the closing tab, then calling your initialising ... function at the bottom of the last script element, ... in the last script element. ... The DOM will be ready and you don't need to use window.onload (or ...
    (comp.lang.javascript)
  • Re: DOMContentReady and focus() in Opera
    ... and onload. ...  Have the onload listener check to see if the DOM ready ... script has run, if not, set the focus. ...
    (comp.lang.javascript)
  • Re: Including new scripts
    ... So this is also true if a SCRIPT element is added to the DOM while loading? ... Not sure it is even possible to manipulate the DOM when the head section is still being parsed. ... When the event comes that the page has finished loading I really need to rely on everything being available. ...
    (comp.lang.javascript)