1. The form of $(function () {...}) is the ready event handler of the document object.
The evolution is as follows: 1.1 - 1.3 more and more simplified
1.1
$(document).on('ready', function () {
$('#testForm).on('submit', function () {
alert('submit!');
});
});
1.2
$(document).ready(function () {
// on('submit', function)也可以简化:
$('#testForm).submit(function () {
alert('submit!');
});
});
1.3
$(function () {
// init...
});