jquery - What does putting a javascript function inside a '$()' do? -


i'm learning ajax right , jquery function being used submit form wrapped inside $( function() { } ) so. do?

$(function() {     $('.error').hide();     $(".button").click(function() {         // validate , process form here     } }); 

this shortcut provided jquery running code on page ready. equivalent to:

$(document).ready(function() {     ... }); 

jquery call function when page ready manipulated.

docs


Comments

Popular posts from this blog

delphi - TJvHidDeviceController "DevicePath" always showing "\" -

Disabling Android home button for industry application -

asp.net mvc 3 - Unexpected "foreach" keyword after "@" character -