混合Prototype和jQuery

时间:2014-08-13 18:39:24

标签: jquery prototype

如何混合使用jQuery和Prototype并充分利用这两个世界?

var htmlret = new Element('div');
htmlret = htmlret.update(response.responseText);


// There may be many .SOME-CLASS so use `invoke` to iterate through them
// $$('.clsProPicture').invoke('update', html.select('.clsProPicture').first());

htmlret = htmlret.down("div#dvltrProfilePic");
//alert(htmlret);
$('dvltrProfilePic').update();
$('dvltrProfilePic').update(htmlret);

一些jQuery方法等

1 个答案:

答案 0 :(得分:6)

您可以使用jQuery' noConflict。它释放$符号,因此您可以将其用于PrototypeJS,将jQuery用于jQuery。 noConflict也会返回jQuery函数,因此您可以将其指定给您想要的任何其他符号,例如:

var $j = jQuery.noConflict();
相关问题