Created
May 2, 2013 13:05
-
-
Save mrdanadams/5502042 to your computer and use it in GitHub Desktop.
Conditionally loading jQuery / Zepto.js in Rails 3
This file contains 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
#= require jquery | |
#= require application.js |
This file contains 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
#= require ../../../vendor/assets/javascripts/zepto.min.js | |
#= require application.js |
This file contains 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
# normal application js included in both IE and other browsers |
This file contains 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
<!-- application layout --> | |
<!-- include this at the bottom of the head or body --> | |
<script> | |
document.write('<script src="' + | |
('__proto__' in {} ? '<%= path_to_asset("application-zepto.js") %>' : '<%= path_to_asset("application-ie.js") %>') + | |
'"><\/script>'); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment