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

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -