When I declare a basic function in the on document ready listener, it cannot be used on any inline javascript code as shown below. However, when I call window.alertMeTwo() on the inline function, it works.
How can I reference a function of Window that hasn't been created yet?
How does this linking process possible work?
var alertMeOne = function { alert(); }
//works inline
window.alertMeOne = function {alert()};
//works inline
jQuery(document).ready(function() {
var alertMeTwo = function(){alert();}
// does not work inline
window.alertMeTwo = function(){alert()};
//works inline????
});
<head>
<!-- ref to js file here -->
</head>
<body onclick="javascript:alertMeTwo()">
</body>