संभव डुप्लिकेट:
What is the difference between these jQuery ready functions?
jquery: Choosing a document.ready methodमतभेद
क्या इस
$(function() {
$("a").click(function(event){
alert("Thanks for visiting!");
});
});
कर के बीच अंतर है और इस
$(document).ready(function(){
$("a").click(function(event){
alert("Thanks for visiting!");
});
});
पूर्व कम शब्दों वाले जब आप मुहावरा, अधिक पठनीय आदत हो और,। अन्यथा उनके समान प्रभाव पड़ता है। – tvanfosson