Learning Kentico: Linking JavaScript files to pages

Just a quick post about something I learned new today.

I didn't know that there's  a Javascript web part that you can use to easily link it to your page and this can just be done in the Portal. So cool!

First, you will need to create your own javascript file by going to Development -> Javascript files and click Create. 


create javascript in kentico


Then go to the Page where you want to add a Javascript and select Javascript web part. Click configure web part and in the Linked Javascript section, select the javascript that you just created.

linking javascript file to pages

You also have the option to select where it should be located in a page like in a start up script, beginning of a page and header section. And of course, you  can always add in-line javascript also.

No comments:

Post a Comment

Post Top Ad