1. snippet çalışmıyordu. Ancak, $ (dolar işareti) jQuery (2. snippet'e bakın) ile değiştirilirken çalışmaya başlar. Ama neden gerçekten anlamıyorum? Bunu bana açıklayan var mı? Çok teşekkürler!
1 Pasaj
jQuery.noConflict();
$(document).ready(function(){
$("#insideTable > tbody > tr:odd").addClass("odd");
$("#insideTable > tbody > tr:not(.odd)").hide();
$("#insideTable > tbody > tr:odd").show();
$("#insideTable > tbody > tr.odd").click(function(){
$(this).next().toggle();
$(this).find(".arrow").toggleClass("up");
});
});
2 Pasaj
jQuery.noConflict();
jQuery(document).ready(function(){
jQuery("#insideTable > tbody > tr:odd").addClass("odd");
jQuery("#insideTable > tbody > tr:not(.odd)").hide();
jQuery("#insideTable > tbody > tr:odd").show();
jQuery("#insideTable > tbody > tr.odd").click(function(){
jQuery(this).next().toggle();
jQuery(this).find(".arrow").toggleClass("up");
});
});
Bu cevap! – trusktr
Bu çalışma, sadece 'hazır' geri çağrısına geçen ilk argümanın jQuery nesnesi olduğunu belirtmek ister, böylece '.ready (function ($) {' ve sonra '$' işlevini fonksiyonun içinde kullanabilirsiniz. Dış şeyler için kullanmanız gerekmediği sürece. – loganfsmyth