I have a javascript file that self invokes and I am trying to get the moduleID in my onClick event.
What am I doing wrong here? Another thing to note is that I have several of these files being included as "Widgets" all with their own moduleID. I am afraid that if I were to move this variable declaration above, making it a global, if its going to interfere with the other widgets that are also declaring a moduleID variable?
$(function() {
// Define our vars
var moduleID = 4,
output = '';
... Some more stuff ...
});
//Listen for button click
$('[name=adminSearchGo]').click(function() {
alert(moduleID); // No Access
});