I just created a Trac ticket with an Enhancement Patch<http://dev.rubyonrails.org/ticket/3506>to the AssetTagHelper, but figured I would post a note here as well to open up discussion of this addition (if any existed). -- DeLynn Berry delynn@gmail.com _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
On Jan 16, 2006, at 11:05 AM, DeLynn Berry wrote:> I just created a Trac ticket with an Enhancement Patch to the > AssetTagHelper, but figured I would post a note here as well to > open up discussion of this addition (if any existed). >Hey DeLynn, I''m curious about the implication of sequence in including javascripts. You said: "This is valuable if you need to have a script load prior to the inclusion of the Prototype and Scriptaculous Javascript libraries." In my own tests, I wasn''t able to reproduce this effect--the sequence of <script src="..."> tags didn''t seem to result in one script being loaded before the other. Have you seen different results? Perhaps on some browsers only? Duane Johnson (canadaduane) http://blog.inquirylabs.com/ _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
> In my own tests, I wasn''t able to reproduce this effect-- > the sequence of <script src="..."> tags didn''t seem to > result in one script being loaded before the other. > Have you seen different results? Perhaps on some browsers only?I had actually only tested the patch with the asset_tag_helper_test (figuring that would be enough--silly me). You are correct though, that the functionality doesn''t seem to work as advertised within an actual application. I''m going to look into this problem a bit further, but what I *can* say right now is that if I switch around the assertion in the test(s) they fail as expected. Thanks for the feedback. -- DeLynn Berry delynn@gmail.com
Duane, Don''t know if this could have been what you are seeing, but the "application" file (either .js or .css) will always come immediately following the "default" set of js or css files. Right now I can''t come up with a good way to re-order that one file, but putting a css or js file before the :defaults symbol in the method call should put those files into the markup prior to the default files. Let me know if you are still seeing weirdness. -- DeLynn Berry delynn@gmail.com
On Jan 16, 2006, at 2:30 PM, DeLynn Berry wrote:> Duane, > > Don''t know if this could have been what you are seeing, but the > "application" file (either .js or .css) will always come immediately > following the "default" set of js or css files. Right now I can''t come > up with a good way to re-order that one file, but putting a css or js > file before the :defaults symbol in the method call should put those > files into the markup prior to the default files. > > Let me know if you are still seeing weirdness. >No, I''m not actually talking about your patch specifically (sorry for any confusion). I''m just curious about whether or not you''d solved another problem I''ve been having--that of javascript dependencies, i.e. when one javascript depends on another javascript having been loaded first. So far, the order of the <script src="..."></script> tags don''t seem to make any difference with regard to this issue. The javascripts are all loaded asynchronously (from what I can tell) and then the javascript in the calling code (i.e. the HTML file) is then executed. I''ve seen one technique which uses ajax to remotely retrieve a javascript file and then eval() it. I''m not sure if it''s the best method. Anyway, how this impacts your patch and plugin, I''m not sure. I think it merely means that sequence doesn''t matter for the javascript_include_tag method call. Regards, Duane Johnson (canadaduane) http://blog.inquirylabs.com/