Can anyone help me out with this one?
If i have this working example:
var Login = function() {
var handleLogin = function() {//code here
}
var handleForgetPassword = function() {//code here
}
var handleRegister = function() {//code here
}
return {
init: function() {
handleLogin();
handleForgetPassword();
handleRegister();
}
};
}();
jQuery(document).ready(function() {
Login.init();
});
But the next example gives an error. Even though I'm sure the file is loaded. I can't scope the function.
<script src="javascriptLoginfile.js" type="text/javascript"></script>
<script>
jQuery(document).ready(function() {
Login.init();
});
</script>
Error
Uncaught ReferenceError: Login is not defined at HTMLDocument. (login:160) at i (jquery.min.js:2) at Object.fireWith [as resolveWith] (jquery.min.js:2) at Function.ready (jquery.min.js:2) at HTMLDocument.K (jquery.min.js:2)