Is it possible to have a defined function as a handler to jQuery's $(document).ready() instead of anonymous function ?
I've done several experiments but to no avail. One of them is here : http://pastebin.com/XHKPc879.
Yes, it is possible:
function pancakes() { /* Do interesting things */ }
$(document).ready(pancakes);
The problem with your pastebin:
$(document).ready(test());
is the you're calling the test function when you say test(), just drop the parentheses and you're good.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With