Reputation: 688
I have something like:
$(document).ready(function() {
var numberOfTables = 3;
});
Is there anyway that I can access numberOfTables
value from Firebug Console, without having to type inside my script something like: console.out(numberOfTables)
?
Upvotes: 2
Views: 535
Reputation: 1036
Add debugger; inside your function (after declaring your var). Firebug will stop executing the script. Then you can just hover numberOfTables to see its value.
Upvotes: 1
Reputation: 148534
numberOfTables
is internal scope.
so you cant see it
however consider removing the VAR
keyword ( just for debugging !!!)
and it will global
so you can see it.
Upvotes: 2
Reputation: 19305
When the variable goes out of scope, there is nothing you can do to access it. You could set a breakpoint and examine the variable in the debugger without using console
, but it will only be valid while in scope.
Upvotes: 1