Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I import external JavaScript file?

Tags:

tapestry

I need to import a JS file that is hosted on another server and is not part of my application's assets.

How can I import it from within the component?

like image 902
Eleeist Avatar asked Nov 01 '12 14:11

Eleeist


1 Answers

I ended up setting up environmental JavaScriptSupport and calling importJavaScriptLibrary from within setupRender():

@Environmental
private JavaScriptSupport javaScriptSupport;

public void setupRender() {
    this.javaScriptSupport.importJavaScriptLibrary("URL-to-JS-file");
}
like image 153
Eleeist Avatar answered Oct 11 '22 16:10

Eleeist