Marius Feraru wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Fred wrote: > >> I see there were lots of tests cases involved, but no URL is still > >> alive. If you are interested, I'll try reviving some of them and maybe > >> forge something more appropriate as a "proof of concept" for us. > > 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. > So, here it is: > http://gfx.neohub.com/t/getElementsByTagNameTest.html > > And a sample loader (seeing that this already got another request on a > newer thread): > http://gfx.neohub.com/t/loader-test.html 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. The difference in performance will be huge. 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. ;-) <script type="text/javascript" src="load.js"></script> Where load.js is: (function(){ var scripts = ['foo.js', 'bar.js']; for (var i=0, len=scripts.length; i<len; i++){ document.write('<script type="text/javascript" src="' + scripts[i] + '"><\/script>'); } })(); -- 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 -~----------~----~----~----~------~----~------~--~---
