2013-03-14 89 views
0

我已经安装Ajaxim 3.4 ...正常工作与独立,但有问题与我现有的网站.... ajaxim原型冲突与JQuery ....等停止我的jQuery功能。Ajax即时通讯聊天信使冲突betn JQuery和原型

是否有与jQuery ajaxim脚本太....没有原型版本。

任何帮助将不胜感激。

Thanx提前。

+0

'ajaxim'不似乎需要原型:http://ajaxim.com/您是否在使用Prototype来做其他事情? – darshanags 2013-03-14 13:46:13

+0

不,如果我删除prototype.js文件..ajaxim不起作用。 – user2170021 2013-03-14 13:58:15

+0

@雷内对他的回答是正确的。这将是你最好的选择:) – darshanags 2013-03-14 14:04:34

回答

1

原型不如包容,但jQuery的可设置为使用不同的标识符比$

var $j = jQuery.noConflict(); 

// Use jQuery via $j 
$j(document).ready(function(){ 
    $j("div").hide(); 
}); 

// Use Prototype with $(...), etc. 
$('someid').hide(); 

来源:http://docs.jquery.com/Using_jQuery_with_Other_Libraries

这样两个文库可以通过侧使用侧。

现在,如果你自己的代码中使用$标志jQuery的电话,你仍然可以使用自己的代码标识,在onload事件的方法包装所有的工作:

jQuery(function ($) { 
    // Use jQuery with the standard $ sign in this scope, 
    // even if it is assigned to prototype outside of this scope 
    $('#id').whatYouWant(); 
}); 
+0

thnx ....我有ajaxim 3.4.1 ...它的使用原型....我无法对JQuery脚本进行更改,因为它很难让我在整个站点中进行更改。 – user2170021 2013-03-14 13:55:28