jquery noconflict issue #386
Unanswered
rynfindlay
asked this question in
1. Help
Replies: 2 comments
-
Hello, Please email me the original module and the integration you recently coded, and I will review them this weekend. Sincerely, |
Beta Was this translation helpful? Give feedback.
0 replies
-
Including jQuery in Breeze is not possible because jQuery will overwrite $.breeze variables, and Breeze will break. The only way I can see is to include jQuery before the breeze scripts and call breeze_default.xml <?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="breeze.js">
<arguments>
<argument name="bundles" xsi:type="array">
<item name="jquery" xsi:type="array">
<item name="type" xsi:type="string">defer</item>
<item name="active" xsi:type="boolean">true</item>
<item name="sort_order" xsi:type="number">-99999999</item>
<item name="items" xsi:type="array">
<item name="jquery" xsi:type="array">
<item name="path" xsi:type="string">Swissup_BreezeExamples/js/lib/jquery-noconflict</item>
<item name="import" xsi:type="array">
<item name="jquery" xsi:type="string">Swissup_BreezeExamples/js/lib/jquery</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page> js/lib/jquery-noconflict.js jQuery.noConflict();
document.addEventListener('breeze:load', () => {
$.breezemap.jQuery = jQuery;
}); Now, you can use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I’m trying to integrate FME Events Manager which uses a legacy JS plugin (FullCalendar) and keep hitting a
TypeError: $.noConflict is not a function
. I’ve tried adding my own jQuery file via the layout but Breeze always seems to load Cash instead, so $.noConflict is undefined.My breeze_default.xml
What I’ve tried:
Bundled my own jQuery as example above
Tried a “legacy-jquery” AMD wrapper module
Required only my jQuery but require(['jquery'], fn) always returns Cash (not real jQuery).
Can’t get $.noConflict to be a function, always undefined
No matter what I try, I can't seem to get the calendar loading and all other Events modules appear to use a similar legacy calendar plugin.
Does anyone have a solution/workaround?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions