javascript - Why can't I use a <script> tag for jQuery anywhere? -


this issue of scope believe. wish use jquery in joomla module , include code within tags in php source. works:

<script> alert("foo"); </script> 

but doesn't:

<script> alert($.jquery); alert(jquery.jquery); </script> 

which should produce @ least 1 alert box jquery version, alert says "undefined". webpage <head> section includes jquery, , used in html stream before above <script>. don't believe <script> block defines new, independent script scope / context, how behaves.

if want version need

jquery.fn.jquery


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -