簡體   English   中英

為什么summernote不能找到已經包含在gwtbootstrap3中的jquery

[英]Why can't summernote find the jquery already included in the gwtbootstrap3

基本問題是:gwtbootstrap3已經包含了jquery(我想是這樣,見下文)。 如果是這樣,為什么夏令營不能參考它。 我在這里找到了這個答案但我仍然不確定如何繼續。

我在我的GWTBootstrap3項目中添加了Summernote。 然后我將以下鏈接添加到我的HTML頁面,如summernote.org所述。 這非常有效。 雖然我想確保在我的項目中只有必要的鏈接或包含。

<!--  Summernote required includes BEGIN-->
<!-- include libraries(jQuery, bootstrap) -->
<link 
href="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.css" 
rel="stylesheet"> 
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js">
</script> 
<script 
src="http://netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.js">
</script>

<!-- include summernote css/js-->
<link 
href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.3/summernote.css" 
rel="stylesheet">
<script 
src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.3/summernote.js">
</script>
<!--  Summernote required includes END-->

據我所知,gwtbootstrap3已經使用了jquery。 所以我決定注釋掉jquery插件。 現在的問題是summernote在我的chrome瀏覽器的Web控制台中失敗並出現以下錯誤:

未捕獲的TypeError:無法讀取未定義的屬性“fn”

at summernote.js:460
at summernote.js:21
at summernote.js:23

很明顯,這指的是缺少的jquery(如460行所指......)

isWebkit: !isEdge && /webkit/i.test(userAgent),
isChrome: !isEdge && /chrome/i.test(userAgent),
isSafari: !isEdge && /safari/i.test(userAgent),
browserVersion: browserVersion,
jqueryVersion: parseFloat($.fn.jquery), <!-- LINE 460 !!! -->
isSupportAmd: isSupportAmd,
hasCodeMirror: hasCodeMirror,
isFontInstalled: isFontInstalled,
isW3CRangeSupport: !!document.createRange

所以它歸結為這個問題,為什么summernote不能引用已經包含在gwtbootstrap3包中的jquery? 使用NoRessource並手動包含所有必需文件會有什么不同? 這會解決問題嗎? 手動包含哪些文件以及我必須包含它們的方式/位置?

最好的問候漢內斯

我導入上面列出的鏈接的原因是,當開始使用gwtbootstrap3中的summernote時,它將無法正常工作。 即它根本不會出現。 但原因並不是我需要導入上面提到的鏈接。 這可能是我做的其他一些錯誤(或eclipse的一些令人耳目一新的問題)。 使長話短說。 沒有必要導入summernote.org上列出的鏈接。 為什么? 因為它們已經包含在summerp的gwtbootstrap3-extras中。 所以確切地說,導入這些鏈接是相當有害的,因為當有兩個單獨的jquery運行實例時,你會遇到奇怪的問題。 所以答案是。 不要進口它,一切都很好。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM