Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

How to add javascript files that are located elsewhere to custom-theme?

Anonymous Anonymous
2 decades ago Jul 13, 2007 12:24pm
Mauno Haukila
2 decades ago Jul 13, 2007 3:41pm

Here's two possible solutions:

1. Add separate index-file where you set that javascript (example for this can be found from http://forum.itmill.com/posts/list/163.page )

2. Add this javascript file to theme-folder and add it to description.xml.

var heads = document.getElementsByTagName("head");
var script = document.createElement('script');
script.setAttribute("src","http://mycompany.org/scripts/poll.js");
script.setAttribute("type","text/javascript");
heads[0].appendChild(script);