Highlighted

How do I enter javascript at the end of the code?

Explorer ,
Jun 04, 2017

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

Views

189

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How do I enter javascript at the end of the code?

Explorer ,
Jun 04, 2017

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

Views

190

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 04, 2017 0
Jun 05, 2017

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 05, 2017 1
Explorer ,
Jun 05, 2017

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 05, 2017 0
Jun 05, 2017

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 05, 2017 0
Explorer ,
Jun 14, 2017

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 14, 2017 1
Jun 14, 2017

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 14, 2017 1