im trying to load the jquery from the code to prevent double loading of the jquery js file. Just curious how can I do that and still be able to use document.ready to perform operation after开发者_Go百科 document is loaded complete.
thanks
Just load jQuery with a <script>
tag. Really.
You can use the HeadJS framework, which does this for you.
<script>
!window.jQuery && (function() {
alert("jQuery hasn't loaded");
})();
</script>
Basically, write everything you want to do if jQuery hasn't loaded inside the anonymous function.
精彩评论