<script type="text/javascript"> window.jQuery || document .write("<script src='${contextPath}/assets/js/jquery.js'>" + "<"+"/script>"); </script>
通过window.jQuery是判断当前页面是否有引入jQuery,当没有引入就继续执行下面的语句,有则不用。
||为逻辑判断。window.jQuery结果为true直接返回,结果为false则执行document.write。