Hi,
I need to check if jQuery is loaded on a page, and (if not) write a script tag to load it. I found this suggestion by John Resig:makes sense. And, looking at the discussion, it seems that it works for others.Code:<script> if(typeof jQuery === "undefined"){ document.write('<script src="local/jquery.js"></script>'); } </script>
However, when I run it, I get this as the page output:and a javascript errorCode:");it seems that theCode:unterminated string literal</script>
tag - inside the literal string - is being treated as an actual closing script tag, instead of as a string. I've tried switching around double- and single-quotes, to no avail. Any suggestions?
Bookmarks