Hello,
I am using Metronic Front-End v8.0.37.
I'm having a problem activating the menus
My Javascript code:
KTMenu.updateByLinkAttribute(window.location.pathname);
The error I get is:
KTMenu.updateByLinkAttribute is not a function
scripts.bundle.js is added to my project as a library
Hi,
Please put your code below the main scripts and try to run your code on the document ready event when all the core js plugins and scripts are loaded:
<script>
// On document ready
KTUtil.onDOMContentLoaded(function() {
// your code goes here
});
</script>
Hi,
Thanks for your answer but I'm trying and it's not working. My full code:
$(document).ready(function (){
KTUtil.onDOMContentLoaded(function() {
KTMenu.updateByLinkAttribute(window.location.pathname);
});
});
Hi,
Could you please provide us with your test link to debug your code online? Probably the core scripts are not loaded during your code call.
Regards.
Hi Sean, thank you for interesting.
I updated script.bundle.js and my problem is solved.
Hi ,
Great! If you need any further help please let us know.
Regards.