You're immediately calling an anonymus function with a specific parameter.
An example:
(function(name){
alert(name);
})('peter')
This alerts "peter".
In the case of jQuery you might pass jQuery
as a parameter and use $
in your function. So you can still use jQuery in noConflict-mode but use the handy $
:
jQuery.noConflict()
(function($){
var obj = $('<div/>', { id: 'someId' });
})(jQuery)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…