Marius Feraru wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Fred wrote:
> >>> The test page for 276037 still works.
> >> Yes, but that test isn't so easy to choke ;-)
> > Do you mean it's too simple? It demonstrates the issue, which is all it
> > needs to do.
> You just proved my point, it doesn't (see below) ;-)

You proved my point: I don't understand what you mean by "choke".

>
> > Why is getLastElementByTagName so complicated?  I don't understand the
> > purpose of recursion over descendant nodes rather than just getting the
> > last member from the collection returned by getElementsByTagName.
> Because of the subject of this topic - getElementsByTagName fails (at
> least on Gecko) while document is loading. Run my test on Gecko and you
> will see lots of red labels (errors). Please view source :)

It only fails in one single scenario: if you use document.write to add
elements from within the same script element that is trying to use
getElementsByTagName, *and* you are trying to get a reference to those
elements.

For a load script, there is no reason to use getElemensByTagName
multiple times: you only have to get the path once per loader script
element - the path of the current script isn't going to change.

Therefore you can use getElemetsByTagName quite happily in a script
loader.

>
> > As for your loader function, you seem to make provision within your
> > scripts array to include different paths, so why not do that and
> > dispense with getting the path of the current script element
> > altogether?  The whole function then becomes a simple iteration over
> > the scripts array with document.write to add them.  ;-)
> Wrong, as this means scripts have paths relative to the current
> _document_ (vs current _script_).

Gimme a break.  You've got to get the path from somewhere, you can
either get it from the current script element or a parameter.  You can
make them relative to either path, or absolute, it's up to you.

The use of getElementsByTagName doesn't have any impact on that other
than being one of the tools (probably the best) you can use to get the
path of the current script element.

-- 
Fred


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to