2016-08-22 148 views
0

我在使用前端方面很新穎,但是我發現JS對於在客戶端執行操作非常有用。JQuery 1.12.3(Datatables)與JQuery 1.7.2衝突(JQuery-UI)

目前我正在使用默認模板爲flask網站提供服務。

僅用於本頁面包含一個JQuery Datatable

最近,我發現需要打開一個彈出對話框,PDF文件(iframedialog),但進口碰撞,只有在工作的時候兩個中的一個。

DataTable中進口下面的:

<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css"> <style type="text/css" class="init"></style> 
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.js"></script> 
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script> 

且彈出式啄那些:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script> 
<link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/blitzer/jquery-ui.css" rel="stylesheet" type="text/css" /> 

沒有1.7.2表加載成功,但用戶界面,出現以下錯誤崩潰:

jquery-ui.js:9833 Uncaught TypeError: $.curCSS is not a function

有了它,數據表不會oad:

table:3704 Uncaught TypeError: $(...).DataTable is not a function

雖然這很可惡here是完整的模板代碼。

+2

使用最新的jQuery UI的 –

+1

這實際上做的工作,我笨,千恩萬謝的版本。 – EndermanAPM

回答

1

正如Pranav C Balan在評論中指出的,我只需要使用更新的JQuery-ui版本,它的工作完美無瑕。

這裏是JQuery的進口與目前的最新版本:

<script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js" type="text/javascript"></script> 
<link href="https://code.jquery.com/ui/1.12.0/themes/blitzer/jquery-ui.css" rel="stylesheet" type="text/css" />