Home > Article > Web Front-end > Method of dynamically loading jQuery_jquery
The example in this article describes the method of dynamically loading jQuery. Share it with everyone for your reference. The details are as follows:
function checkJquery() { if(!(window.jQuery)) { var s = document.createElement('script'); s.setAttribute('src', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'); s.setAttribute('type', 'text/javascript'); document.getElementsByTagName('head')[0].appendChild(s); } }
I hope this article will be helpful to everyone’s jQuery programming.