Script & jQuery

jquery load 여부에 따라서 jquery load

yeon.Biju 2017. 12. 13. 09:10

 jquery 로드 여부를 확인 한 후에 jquery 로드

jquery 중복 로드되지 않게 햐는 방법 


<script type="text/javascript">

if (typeof jQuery == 'undefined') {

    var script = document.createElement('script');

    script.type = "text/javascript";

    script.src = "/js/jquery.js";

    document.getElementsByTagName('head')[0].appendChild(script);

</script>