public void addJsResource ( final ApplicationResource resource ) { WApplicationModel model = getOrCreateComponentModel ( ) ; if ( model . jsResources == null ) { model . jsResources = new ArrayList <> ( ) ; } else if ( model . jsResources . contains ( resource ) ) { return ; } model . jsResources . add ( resource ) ; MemoryUtil . checkSize ( model . jsResources . size ( ) , this . getClass ( ) . getSimpleName ( ) ) ; }
Add a custom javaScript resource that is to be loaded and used by the application .