check if jquery has been loaded, then load it if false
javascript, jquery
Solution
Maybe something like this:
<script>
if(!window.jQuery)
{
var script = document.createElement('script');
script.type = "text/javascript";
script.src = "path/to/jQuery";
document.getElementsByTagName('head')[0].appendChild(script);
}
</script>
Problem
Does anyone know how to check if jquery has been loaded (with javascript) then load it if it hasnt been loaded. something like ``` if(!jQuery) { //load jquery file } ```