new template but where to put the javascript part

Hello, 


I try ro make a new template so I can use Material design on my projects. 

I have succeed in placing the css cdn on the right place I hope but I can never find where to put the javscript cdn 

<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>


in my new template so I can use it finally.


Someone a hint ? 


Roelof 

Hello,

You can use you javascript code in your screen by :

  • Using the Extended Properties of Web Screens or widgets
  • Within unescaped Expressions
  • Using the RunJavaScript action of the HTTPRequestHandler extension


Check more where: https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/JavaScript/Extend_Your_Web_Application_Using_JavaScript/Define_and_Run_JavaScript_Code


Regards,

NC

I do not have web screens or widgets. This project is meant for making a template. 

So I wonder if I use the last it it's really used then.

I don't think you can do that, because in OutSystems javascript is only used in globally for the Module, web screen or web block ( Client side).

The structure of a UI Theme doesn't allow you to define javascript (https://success.outsystems.com/Documentation/11/Developing_an_Application/Design_UI/Look_and_Feel/Themes).


NC



oke, so I can put the css in a theme but the javascript I need I need to put on every page I need. 

if that is needed I have to do that.


Roelof


Yes, tha'ts right. 


Best regards,

NC

Hi Roelof,

In reactive you should place your JS on the Interface > Scripts.

Than you have to 2 options:

  • In every page, you want that script, on the properties go to required scripts and select the script you want
  • or you can do the same in a layout block and use that layout in all the screens you want

Regards,

Marcelo