Reputation: 4128
The code is:
$function readyFin(jQuery() {
console.log('ready!');
}
$(document).ready(readyFin);
If you can think of a better title for this question, please advise.
I am expecting to see 'ready!' in the javascript console in Chrome, but I do not. Why?
Upvotes: 2
Views: 467
Reputation: 30115
Use function
instead of $function
:
function readyFin() {
console.log('ready!');
}
Example with anonymous function:
$(document).ready(function() {
console.log('ready!');
});
Upvotes: 3
Reputation: 5879
The corrected example
function readyFin(){
console.log('ready!');
};
$(document).ready(readyFin);
Upvotes: 3
Reputation:
try this:
<html>
<head>
<script type="text/javascript">
function readyFin() {
console.log('ready!');
};
$(document).ready(function() {
readyFin();
});
</script>
</head>
<body>
</body>
</html>
please see http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
can you see where the issue is?
Upvotes: 2