We have three JS files:
<script type="text/javascript" src="js/pm.init.js"></script>
<script type="text/javascript" src="js/pm.util.func.js"></script>
<script type="text/javascript" src="js/pm.nav.js"></script>
In init.js we have:
$(function(){
var dirty = false;
})
In util.func.js we have:
function dirtyCheck(actionFunction) {
if (dirty == false) {
actionFunction();
return;
}
...
And in nav.js we have:
$(function(){
$('#btn-nav-refresh').click(function() {
dirtyCheck(function() { doRefresh(); });
});
...
Now when the btn-nav-refresh
function fires after a user clicks the button we get a dirty is not defined
error. Why is this??