Loading custom Javascript

I’d like to use the jqueryui-Accordion in a Component so I wrote som boilerplate code to test it. To get the effects I need to load some javascript, I try to do that with @JavaScript on my UI.

@JavaScript({"https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js",
        "https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js",
        "js/test.js"})
public class MyVaadinUI extends UI {

the Jquery.min.js and the jquery-ui.min.js are loaded successfully, but the test.js doesn’t seem to work.

Is there a syntax how I can get my test.js loaded which is actually saved in the VAADIN/js-Folder?

Hi,
If you would like to serve your script from that path then you have to place the “js” folder in the same package with your MyVaadinUI class. You don’t have to put it in VAADIN folder anymore.

Aleksandr

unfortunately that doesn’t seem to work (actually I’m not sure if its because of vaadin or IntelliJ’s exploded war)

Anyways I’d rather have it in the webapp/VAADIN directory, so is there a way to do that?

I had the same problem (Vaadin 7.0.1) but I solved it by explicitly copying everything as a resource. Look at my reply to a similar post
here
.