Expose version number for bundled jquery.js, for easy use of a CDN#1
Merged
indirect merged 1 commit intorails:masterfrom Jun 1, 2011
Merged
Expose version number for bundled jquery.js, for easy use of a CDN#1indirect merged 1 commit intorails:masterfrom
indirect merged 1 commit intorails:masterfrom
Conversation
…sible place. On production sites, it's nice to use an offsite CDN to serve jquery.js, and there's a nice technique for seamlessly falling back to the local bundled jquery.js if the CDN is unavailable: http://weblogs.asp.net/jgalloway/archive/2010/01/21/using-cdn-hosted-jquery-with-a-local-fall-back-copy.aspx. To ensure that the CDN jquery.js version matches that bundled with jquery-rails, it's necessary to programatically access the bundled version number. This commit allows users to do the following, by ensuring that the jquery version is no longer hidden away in the install generator: = javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/#{Jquery::Rails::JQUERY_VERSION}/jquery.min.js" :javascript if (typeof jQuery == 'undefined') { document.write(unescape(#{URI.escape(javascript_include_tag('jquery')).to_json})); }
Member
|
Looks good, thanks! |
indirect
pushed a commit
that referenced
this pull request
Jun 1, 2011
Expose version number for bundled jquery.js, for easy use of a CDN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On production sites, it's nice to use an offsite CDN to serve
jquery.js, and there's a nice technique for seamlessly falling back to
the local bundled jquery.js if the CDN is unavailable:
http://weblogs.asp.net/jgalloway/archive/2010/01/21/using-cdn-hosted-jquery-with-a-local-fall-back-copy.aspx.
To ensure that the CDN jquery.js version matches that bundled with
jquery-rails, it's necessary to programatically access the bundled
version number. This commit allows users to do the following, by
ensuring that the jquery version is no longer hidden away in the
install generator: