Skip to content

Commit

Permalink
Search for all script[src] occurrences rather than just within the he…
Browse files Browse the repository at this point in the history
…ad. The HTML4 specification states that a <script> tag may occur in the head or body of a document, and with Yahoo (http://developer.yahoo.com/performance/rules.html, see "Put Scripts at the Bottom") and others recommending putting your <script> tags at the end of your body to improve performance, and with Ruby on Rails (and other such frameworks) providing the content_for (http://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html#M001763), it doesn't make sense to insist on loading Prototype and script.aculo.us within the head of a page.
  • Loading branch information
pgib authored and madrobby committed May 5, 2010
1 parent 299f8b9 commit 38b73d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scriptaculous.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var Scriptaculous = {
Scriptaculous.REQUIRED_PROTOTYPE);

var js = /scriptaculous\.js(\?.*)?$/;
$$('head script[src]').findAll(function(s) {
$$('script[src]').findAll(function(s) {
return s.src.match(js);
}).each(function(s) {
var path = s.src.replace(js, ''),
Expand Down

0 comments on commit 38b73d5

Please sign in to comment.