Moi*_*man 2 javascript jquery richfaces
我无法从JSF框架中删除原型(RichFaces 3.3.3).如果我尝试noConflict并试图接管$它会破坏我的应用程序框架,因为它与原型紧密结合.
那么有没有办法可以做到这一点:
jQuery(function() {
/*
some code that within this domready function
allows me to use $() within this function
and not interfere with $ being used for prototype
outside?
*/
});
Run Code Online (Sandbox Code Playgroud)
是的,它已作为ready处理程序的第一个参数传入,只需使用:
jQuery(function($) {
$("selector").doSomething();
});
//$ is still prototype here
Run Code Online (Sandbox Code Playgroud)