Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > How to add javascript into a custom web part? View modes: 
User avatar
Member
Member
steven4733-gmail - 2/23/2012 6:13:04 PM
   
How to add javascript into a custom web part?
I want to add some sharp effect into my custom web parts. I don't want to use html envelop to add javascript. How do you guys do to add JS into a web part?

User avatar
Kentico Support
Kentico Support
kentico_radekm - 2/24/2012 12:32:30 AM
   
RE:How to add javascript into a custom web part?
Hello.

You can either use our Javascript code web part (in General category), or you can simply link it via "<script language="javascript" href="path to js file" />" html tag. Another option is to use ScriptManager class. You can find some additional info here. Thank you.

Best Regards,
Radek Macalik

User avatar
Member
Member
steven4733-gmail - 2/27/2012 9:09:53 AM
   
RE:How to add javascript into a custom web part?
When you use <script type="text/javascript" src="path to js file" />, what do you use as root path? I tried "~/" I also tried "./" neither of them works.