Copy link to clipboard
Copied
I need to insert a code or file in javascript or jquery at the end of the code.
Ex: main.js or app.js
Hello, after much study, I have arranged a way to do this in an integrated way within Muse, I will leave here the step-by-step guide for anyone who wants to know.
First> Upload .js in 'Files to Upload in menu Muse
Second> include Jquery Injector (Widget) from MuseResources (MUSE RESOURCESâ„¢ | jQuery Injector ) and paste the code below:
$.getScript('assets/nameOfUrArchive.js', function(){
});
Please moderators, put this message as the correct answer.
Thank you all for the support
Copy link to clipboard
Copied
Hi,
What is this Javascript intended for?
You can export your .muse as HTML and then tweak or insert any external code or file.
Regards,
Ankush
Copy link to clipboard
Copied
Hello Ankush, first of all thank you for replying.
I would like to do this directly from the Muse panel, using the assets option, but as it is a controller.js it needs to be at the end of the code. So it renders the controller within Preview In Browser.
Copy link to clipboard
Copied
Right, that's the issue.
If you will upload it through Muse then you won't have the control over the execution of that Javascript.
Therefore in your case exporting it via HTML will be the best option.
Regards,
Ankush
Copy link to clipboard
Copied
Hello, after much study, I have arranged a way to do this in an integrated way within Muse, I will leave here the step-by-step guide for anyone who wants to know.
First> Upload .js in 'Files to Upload in menu Muse
Second> include Jquery Injector (Widget) from MuseResources (MUSE RESOURCESâ„¢ | jQuery Injector ) and paste the code below:
$.getScript('assets/nameOfUrArchive.js', function(){
});
Please moderators, put this message as the correct answer.
Thank you all for the support
Copy link to clipboard
Copied
Woah, Thank you so much for this superb workaround and it will be really very helpful for our other user's as well.
Cheers.