1. 程式人生 > >TypeError: $(...).dialog is not a function debug過程

TypeError: $(...).dialog is not a function debug過程

當你的專案裡有運用到bootstrap和jquery UI兩個JS外掛的時候,你就知道錯了……二者在很多方面都會存在衝突,比如我遇到一個問題debug了很久,錯誤如下:

TypeError: $(...).dialog is not a function

根據stackoverflow上的解釋,都是說jquery.js重複。然而我找了半天,都沒有發現我有重複的地方。後來突然想到,是不是jquery UI與bootstrap起衝突導致的。

再一搜索,果然網上有很多關於這兩個庫相愛相殺的例子。我決定實驗一下下。將兩個庫全部引入

  <link rel="stylesheet" href="http://apps.bdimg.com/libs/jqueryui/1.10.4/css/jquery-ui.min.css">
  <link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css">  
  <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
  <script src="http://apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
  <script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script>

再看彈框,整個樣式都變了。不過還是可以彈出來。難道是我引用的檔案有問題?還是我的框架導致的引用檔案重複?

-。-然並卵,我在bootcss上找到另一個外掛:http://www.bootcss.com/p/jquery-ui-bootstrap/index.html

據說可以二者相親相愛地使用,等我使用好了再來好好記錄一下。

先馬克。

相關推薦

TypeError: $(...).dialog is not a function debug過程

當你的專案裡有運用到bootstrap和jquery UI兩個JS外掛的時候,你就知道錯了……二者在很多方面都會存在衝突,比如我遇到一個問題debug了很久,錯誤如下: TypeError: $(...).dialog is not a function 根據stackov

關於使用easyui 中提示dialog is not a function的問題

我們經常在一些專案使用easyui,當然必不可少都會用到dialog這個功能,但是有時候你會發現: 明明我的程式碼沒有錯誤,呼叫的規範按照API的來撰寫,但是還有會報 $(...).dialog is not a function的錯誤呢??? why!!!?? 答案就是: 你在子模組,也就是di

通過jquery dialog為什麼提交不了form表單 和 $("#Form").ajaxSubmit(options) is not a function 的原因

1.jquery dialog為什麼提交不了form表單  $("#dialog").dialog({                 autoOpen: false,                 height: 500,                 width:

Combobox報錯:row[opts.textField].toLowerCase is not a function

light peer mem div clas erro sea error () 使用easyui框架加載combobox。 html頁面: <span class="search_item">   <span class="item_text">

$.cookie is not a function;原因及解決辦法

方法 () 通過 js文件 func cti query 原本 cookie 一、沒有引入jQuery庫文件二、jQuery庫文件和jquery.cookie.js文件的順序問題。須先引入jQuery庫文件再引入cookie插件文件三、頁面的加載順序所導致大家的問題大多出在

db.collection is not a function

版本 pan fun pac 資料 div col pos reac   翻出以前用react寫的APP,發現裏面的數據都出不來,我就知道我的數據庫又被黑掉了,用mongodb圖形化工具將備份的數據導入之後,開始編寫代碼。但是啟動接口發現居然報錯了========“db.c

js報錯 Uncaught TypeError: xxxx.each is not a function

each err typeerror span xxx list 報錯 pan 使用 在處理ajax返回的json數組時錯誤的使用了 list.each(function(){ }); 實際上當遍歷json數組是應該使用

微信小程序 this.setData is not a function

ava ucc post scrip hang pic javascrip form 定時   在一般的函數中: 1 bindFaChange1: function (e) { 2 console.log(‘picker發送選擇改變,攜帶值為‘, e.detail

jquery.min.js?v=2.1.4:4 Uncaught TypeError: (b.contentType || "").indexOf is not a function

前臺運行 gpo 前臺 add cati json log ont fun 前臺運行PUT時出現錯誤:jquery.min.js?v=2.1.4:4 Uncaught TypeError: (b.contentType || "").indexOf is not a fun

webpack4: compilation.mainTemplate.applyPluginsWaterfall is not a function 解決方法

webpack class gin 安裝 fall log 大坑 谷歌 維護 今天搗鼓webpack4踩到一個彌天大坑:使用html-webpack-plugin打包html的時候一直報 compilation.mainTemplate.applyPluginsWaterf

報錯 _react3.default.createClass is not a function

component point create sla contents 新版本 body values origin 這個是因為react最新版本拋棄使用了createClass這個函數,這個也是為了配合ES6 。這種情況下會報錯 var Popover = Reac

Uncaught TypeError: o.block is not a function

erro TP 9.png .com In type ima alt typeerror 未捕獲TypeError:o。block不是一個函數 js少引,或者路徑錯誤Uncaught TypeError: o.block is not a function

【vue開發問題-解決方法】(四)vue Element UI使用中.$scopedSlots.default is not a function 報錯

判斷 元素 技術分享 error: class 解決 nbsp AR peer 當使用elementUI中v-if來判斷顯示元素時,會報錯。 vue.js:600 [Vue warn]: Error in render: "TypeError: l.$scopedSl

【vue開發問題-解決方法】(四)vue Element UI 日期選擇器獲取日期格式問題 t.getTime is not a function

format PE man UNC cti bubuko 圖片 orm ID 現有一表單需要填寫日期,采用了elementUI中日期選擇器,但是獲取到的數據格式是 Mon Jun 18 2018 00:00:00 GMT+0800 (中國標準時間) 而我需要的數

$(...).wordExport is not a function

func ready view function cti 修改 報錯 jquer html 參考網址:https://laod.cn/code-audit/jquery-is-not-a-function.html 問題描述: 1.vi

Bootstrap的$(...).modal is not a function錯誤

題解 info http image 9.png not get boot bubuko 使用模態對話框的時候報錯了,$(...).modal is not a function 有點蒙,modal是boostrap的函數,而我已經導入了 然後在pycharm的termi

Uncaught TypeError: window.showModalDialog is not a function 谷歌

sop fun replace 原創文章 aso csdn 版權 使用 parent //新版本谷歌沒有window.showModalDialog,創建一個window.openif(window.showModalDialog == undefined){ windo

window.showModalDialog 在谷歌Uncaught TypeError: undefined is not a function

oda help fun use 版權 index typeerror undefine modal if(navigator.userAgent.indexOf("Chrome") >0 ){var winOption = "height="+height+",wi

關於YII2框架-jQuery(…).activeform is not a function in 解決方法

在使用YII2框架過程中遇到過控制檯報出一個JS錯誤,jQuery(…).activeform is not a function,檢視原始碼看到這裡。 確定一下yii框架這個檔案有沒有載入 yii.activeForm.js 沒有的話,那麼問題原因就找到了。 解決方案有很多種

vue element el-table 傳的值報_self.$scopedSlots.default is not a function

點選修改的時候,頁面的預算佔比呈現輸入框的形式,確認修改之後,資料改變,也要把輸入框關閉,變成文字形式。這裡需要改變table的el-table-column值     1 <el-table 2 :data="newlist" 3