JS plugin bundle conflict with older JS
Hi, is there any way we can avoid the conflict? I am upgrading my old laravel website's UI using metronic but a lot of functions are disabled when I use the plugin bundle. Dont know where to start
Dont know where to start because no error on console.
Does the old laravel is a Metronic Laravel or your own custom Laravel? Could you please try to put the plugins.bundle.js file at the top of other JS files?
Old laravel is custom not Metronic.
Suprisingly putting the JS below the bundle sorts some of the functionalities.
But some still not able to function as usual for example profile photo upload/crop, after selecting the photos, there should be a preview/crop screen, but nothing appear, no error. However I find the photo did get uploaded to the server but reference in database. Once i commented on the plugin.bundle, it works as usual.
I am still looking around to see what other that isnt working, will update with you guys.
EDIT: i take back my words, once i put old JS below the bundle, metronic stepper button no longer works
Sorry for the late reply. Can you try to use the document-ready handler to run your code:
// On document ready
// my code goes here
Right, when you access a 3rd-party plugin it should be loaded and available in your context. So using onDOMContentLoaded will solve most of the issues. If you need any further help please provide us with your test link so we can debug your page online. Otherwise, we can't predict the issue without looking at your code since the issue is related to your custom code, not a general theme issue.