The difference is that the commented out version assumed that jQuery
is the only JS library, as the $ function is used in other libraries,
such as mootools and Prototype, so the jQuery(function($) { }) stops
any conflicts

Rik

2008/11/6 Liam Potter <[EMAIL PROTECTED]>:
>
> he's commented out the jquery call out.
> All you would need is this;
>
> jQuery(function() {
>        $("#div1").load("starterkit.html");
>               });
>
>
>
> Satyakaran wrote:
>>
>> Difference between the two code?
>>
>> On Nov 6, 12:36 pm, Satyakaran <[EMAIL PROTECTED]> wrote:
>>
>>>
>>>        function load() {
>>>                //jQuery(function($) {
>>>                        $("#div1").load("starterkit.html");
>>>                //});
>>>        }
>>>
>>> OR
>>>
>>> function load() {
>>>        jQuery(function($) {
>>>                $("#div1").load("starterkit.html");
>>>        });
>>>
>>> }
>>>
>>> Can you tell me what is the difference between the two. I know both
>>> works.
>>> So, which one should I use. I am talking about the commented code on
>>> first snippet.
>>> Thanks!
>>>
>
>



-- 
Rik Lomas
http://rikrikrik.com

Reply via email to