Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Sidebar Menu Not Activated


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


Text formatting options
Submit

Replies (5)


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>


Regards.



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);
});
});


and error: plugins.bundle.js:25 jQuery.Deferred exception: KTMenu.updateByLinkAttribute is not a function TypeError: KTMenu.updateByLinkAttribute is not a function

i am using MVC 5



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 happy,

Great! If you need any further help please let us know.

Regards.


Your Support Matters!

We will highly appreciate your Metronic Review on Themeforest.
Please go to Themeforest Downloads page, select Metronic & leave your feedback.
Text formatting options
Submit
Text formatting options
Submit