Jquery No Conflict (jquery.noconflict)

noconflict




Jika javascript atau jquery anda ada yang tidak jalan di antara tumpukan javascript lainnya, kemungkinan konflik, maka gunakan jquery.noconflict seperti contoh berikut:


$.noConflict();

jQuery(document).ready(function($){
// your codes
});


// More code using $ as alias to jQuery
(function($){
// your code
})(jQuery);


// Other code using $ as an alias to the other library
var jq=jQuery.noConflict();
jq(document).ready(function(){ 
// your code});


// Do something with jQuery
j("div p").hide();


// Do something with another library's
$("content").style.display = "none";


// Do something with the new jQuery
dom.query( "div p" ).hide();


// Do something with another library's
$("content").style.display = "none";


// Do something with another version of jQuery
jQuery( "div > p" ).hide();




Sumber: yudiyusti[dot]com
Sekian, terimakasih atas kunjungannya.
Salam,
PHP Aku : Membangun web terorganisasi dan mudah dimengerti, contoh tutorial dengan menggunakan HTML, CSS, JavaScript, SQL, PHP, dan XML.
First


EmoticonEmoticon