Is it possible to call a javascript function from an .html file while in a .js file? For example, I have this in my foo.js:
$(document).ready(function() {
fn();
})
And I want to call fn() which is in my index.html:
<script type="text/javascript" src="js/foo.js"></script>
<script type="text/javascript">
function fn() {
.....
}
</script>
When I do this, it doesn't seem to be calling fn().