2013-03-14 59 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