Hi I am never that good at JQuery so decided to spend some time to really enhance my skill, I found this really good tut, but there is one thing I don't understand.
In this http://www.jquery-tutorial.net/intro...e-ready-event/ .ready method, the last example use an overload function,
puzzeled me:
<script type="text/javascript">
$(function()
{
$("#divTest3").text("Hello, world!");
});
</script>
the previous two examples both have $(document).ready(....
the above one doesn't have it.
What I try to understand is how does JQ know it is $(document).ready? or is it be default the overload has to be $(document).ready?
Please pardon me for the dumb question, if someone can help me to understand it, I greatly appreciate.
It's just a shorter way of specifying a document ready event handler. jQuery simply checks if the argument to $() is a function, and if it is it assumes it's a handler for the document ready event.
Thanks for the reply refeezed. So you mean by default JQ will use it in document.ready? Did I understand correctly?
What if I want to use it in other methods other than .ready()?
Bookmarks