Do jQuery and JavaScript have different namespaces?
Posted
by Brett
on Stack Overflow
See other posts from Stack Overflow
or by Brett
Published on 2010-04-08T04:03:12Z
Indexed on
2010/04/08
4:13 UTC
Read the original article
Hit count: 339
jQuery
|JavaScript
I have this code in jQuery..
$(document).ready(function(){
var fieldCounter = 0; ...
I have a jQuery function that increments this value.
This works, but I can't access this value on the page from a non-jQuery function? The reverse is also true, if I scope it in JavaScript e.g.
<script type="text/javascript">
var fieldCounter = 0;
I can access it from javascript but jQuery can't view it?
I'm probably doing something really dumb?
© Stack Overflow or respective owner