$(function () {
var mainimagepanel = $("#blah1");
var postimagepanel = $("#blah2");
});
both object exist on the page where i run my $. can someone show me why i got exception mainimagepanel is not defined
the exception caused in Firebug or Chrome dev tool. so someone can tell me reason and how i can check that a input control exist on both.
Your variables are declared inside the anonymous function, and that is their scope. They do not exist outside that function. To fix it, you can do something like:
It is however usually good advice to limit your variables so that they exist in the tightest possible scope.