-
Hi, I have an overview page with a lot of products. Some parts of the views are not used except when the user clicks on a button. (a modal pops up). Because of that I have decided to fetch the html of this modal through javascript. Everything works fine but now I'm in a situation that a part of the modal content includes a small script. But because of the call through javascript I only receive the html but not the scripts. Is there a way to add the scripts to the end of the body with javascript? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You could have a look at how the Flows module does it. Specifically in the This is where it is evaluating the scripts https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore.Modules/OrchardCore.Flows/Assets/js/flows.edit.js#L36-L39 |
Beta Was this translation helpful? Give feedback.
You could have a look at how the Flows module does it. Specifically in the
Display.cshtml
https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore.Modules/OrchardCore.Flows/Views/Admin/Display.cshtml. It returns the content (html) and scripts separate which can then be used by javascript to place the html and scripts where you want them.
This is where it is evaluating the scripts https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore.Modules/OrchardCore.Flows/Assets/js/flows.edit.js#L36-L39