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
Post a Comment