簡體   English   中英

如何使用兩個具有相同名稱的jQuery插件?

[英]How can I use two jQuery Plugins having the same name?

在一個大型的Web項目中,我想使用一個editable的jQuery插件,該名稱與現有名稱相同,但具有不同的行為。
有一種簡潔的方法來重命名插件? 也許使用require.js?

您可以像這樣重命名插件:

<script src="jquery.js"></script>
<script src="firstplugin.js"></script>
<script>
    $.fn.editableFirst = $.fn.editable;
</script>
<script src="secondplugin.js"></script>

editableFirst應該對你更有意義。

暫無
暫無

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

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