简体   繁体   English

如何使用两个具有相同名称的jQuery插件?

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

In a big web project I would like to use a jQuery Plugins editable which name is the same of the exiting one but have a different behaviour. 在一个大型的Web项目中,我想使用一个editable的jQuery插件,该名称与现有名称相同,但具有不同的行为。
There is a clean way to rename the plugin? 有一种简洁的方法来重命名插件? Maybe using require.js? 也许使用require.js?

You can rename the plugin like this: 您可以像这样重命名插件:

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

editableFirst should be something more meaningful to you. editableFirst应该对你更有意义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在同一页面上将插件用于不同版本的jQuery? - How can I use plugins for different versions of jQuery on the same page? 如何在同一个 jQuery 函数中使用两个 append? - How can i use two append in the same jQuery function? 我如何在 angular 中使用 3rd 方 jquery 插件? - how can i use 3rd party jquery plugins in angular? 两个具有相同函数名称的jquery插件之间的冲突 - conflict between two jquery plugins with same function name 如何使用 cy.intercept 存根两个同名请求但返回两个不同的主体? - How can I use cy.intercept to stub two requests of the same name but return two different bodies? 如何使用每个 function ZD223E1439188E4578349D542 在两个相同的 class 名称上添加 class? - How can i add a class on two same class name using a each function jquery? 两个具有相同类名的 jquery 滑块,但问题在于移动滑块 (2) - Two jquery sliders having same class name but the issue is on moving the slider (2) 如何在Ionic 3上使用cordova插件? - How Can I Use cordova plugins on Ionic 3? 如何在同一脚本中使用 jQuery jScrollPane 和 scrollTo 插件 - How to use jQuery jScrollPane and scrollTo plugins in the same script 如何在JavaScript中使用getElementByClassName在具有相同类名的两个列表中添加复选框 - How to use getElementByClassName in the javascript to add the checkboxes in the two lists having same class name
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM