Here's an example:
//wait till the document file has loaded then executes a function (with no parameters)
$(document).ready(function() {
//print out "Hello" to the console.
console.log("Hello");
//close
})
You can also do the short hand.
//the (document).ready is optional.
$(function() {
console.log("Hello");
})
No comments:
Post a Comment