简体   繁体   中英

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.
There is a clean way to rename the plugin? Maybe using 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM