Created
July 29, 2013 15:11
-
-
Save shinnn/6105039 to your computer and use it in GitHub Desktop.
Jadeで、jQueryの読み込みを丁寧かつ簡潔に書く ref: http://qiita.com/shinnn/items/d36468ca91ac35399f0b
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
<!--[if lt IE 9]> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<![endif]--> | |
<!--[if gte IE 9]><!--> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
<!--<![endif]--> |
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
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
<script> | |
window.jQuery || document.write("<script src='local_copy_path/jquery.js'><\/script>"); | |
</script> |
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
mixin loadJQuery( version ) | |
script(src="https://ajax.googleapis.com/ajax/libs/jquery/#{ version }/jquery.min.js") | |
script. | |
window.jQuery || document.write("<script src='js/jquery-#{ version }.min.js'><\/script>"); | |
//- このMixinの引数を、IE9以下で使用するjQueryのバージョン文字列にする | |
<!--[if lt IE 9]> | |
+loadJQuery('1.10.2') | |
<![endif]--> | |
//- このMixinの引数を、通常使用するjQueryのバージョン文字列にする | |
//[if gte IE 9]><! | |
+loadJQuery('2.0.3') | |
//<![endif] |
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
<!--[if lt IE 9]> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script> | |
window.jQuery || document.write("<script src='js/jquery-1.10.2.min.js'><\/script>"); | |
</script> | |
<![endif]--> | |
<!--[if gte IE 9]><!--> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
<script> | |
window.jQuery || document.write("<script src='js/jquery-2.0.3.min.js'><\/script>"); | |
</script> | |
<!--<![endif]--> |
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
<!--[if lt IE 9]> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script> | |
window.jQuery || document.write("<script src='js/jquery-1.10.2.min.js'><\/script>"); | |
</script> | |
<![endif]--> | |
<!--[if gte IE 9]><!--> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
<script> | |
window.jQuery || document.write("<script src='js/jquery-2.0.3.min.js'><\/script>"); | |
</script><!--<![endif]--> |
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
mixin loadJQuery( version ) | |
script(src="https://ajax.googleapis.com/ajax/libs/jquery/#{ version }/jquery.min.js") | |
script. | |
window.jQuery || document.write("<script src='js/jquery-#{ version }.min.js'><\/script>"); | |
//- このMixinの引数を、IE9以下で使用するjQueryのバージョン文字列にする | |
//if lt IE 9 | |
mixin loadJQuery('1.10.2') | |
//- このMixinの引数を、通常使用するjQueryのバージョン文字列にする | |
//if gte IE 9 | |
<!--> | |
mixin loadJQuery('2.0.3') | |
<!-- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment