Skip to content

Instantly share code, notes, and snippets.

@japharr
Created February 14, 2015 11:06
Show Gist options
  • Save japharr/0e04b31a998abb1eb33a to your computer and use it in GitHub Desktop.
Save japharr/0e04b31a998abb1eb33a to your computer and use it in GitHub Desktop.
Resources or CDN
<!-- jQuery
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script> -->
<script th:src="@{/resources/plugins/jquery/1.11.2/jquery-1.11.2.min.js}"></script>
<script type="text/javascript" th:inline="javascript">
// <![CDATA[
window.jQuery || document.write('<script th:src="@{/resources/plugins/jquery/1.11.2/jquery-1.11.2.min.js}"><\/script>')
// ]]>
</script>
<!-- Latest compiled and minified CSS
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"/> -->
<link rel="stylesheet" type="text/css" th:href="@{/resources/plugins/bootstrap/3.3.2/css/bootstrap.min.css}" />
<script type="text/javascript" th:inline="javascript">
$.each(document.styleSheets, function(i,sheet){
if(sheet.href=='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css') {
var rules = sheet.rules ? sheet.rules : sheet.cssRules;
if (rules.length == 0) {
$('<link rel="stylesheet" type="text/css" th:href="@{/resources/plugins/bootstrap/3.3.2/css/bootstrap.min.css}" />').appendTo('head');
}
}
})
</script>
<!-- Optional theme
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"/> -->
<link rel="stylesheet" type="text/css" th:href="@{/resources/plugins/bootstrap/3.3.2/css/bootstrap-theme.min.css}" />
<script type="text/javascript" th:inline="javascript">
$.each(document.styleSheets, function(i,sheet){
if(sheet.href=='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css') {
var rules = sheet.rules ? sheet.rules : sheet.cssRules;
if (rules.length == 0) {
$('<link rel="stylesheet" type="text/css" th:href="@{/resources/plugins/bootstrap/3.3.2/css/bootstrap-theme.min.css}" />').appendTo('head');
}
}
})
</script>
<!-- Latest compiled and minified JavaScript
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> -->
<script th:src="@{/resources/plugins/bootstrap/3.3.2/js/bootstrap.min.js}"></script>
<script type="text/javascript" th:inline="javascript">
// <![CDATA[
window.jQuery.fn.modal || document.write('<script th:src="@{/resources/plugins/bootstrap/3.3.2/js/bootstrap.min.js}"><\/script>')
// ]]>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment