I have a web application using vaadin .
I gave a freelancer to do my static website. he gave me an html file, css files and a few js files.
I managed to load the html with the customlayout and managed to use the css (just by copying the content into myTheme.scss ) .
but the js is quite a headach to me. I couldn’t find a way to make it work .
I tried to load te js libraries by “Page.getCurrent().getJavaScript().execute()”
it didnt show an error but it didnt work …
Can you please guide me as for how to do that ?
I don’t understand what your trying to accomplish here. You had someone create a static website for you and you are trying to cram it into a Vaadin application? Why can’t you just host your html, css and js files that the freelancer gave you on a webserver somewhere and call it a day.
Anyway… if you still want to load javascript files when your vaadin app loads, you can add the @JavaScript annotation to your UI class. So, for example lets say I wanted to load a javascript file named “helpMe.js” which was located in your themes folder called myTheme, you could do the following: @JavaScript({“vaadin://themes/myTheme/helpMe.js” })
public class MyUI extends UI {
Thank you ! , I did that and it worked. the browser tried to load the js files and yet I have an error on the client side , it shows me error
"Unexpected toke < "
first line on every js file I load
This has something to do with the doctype
Your help be appreciated
Note that whe I execute the html file from the standard file explorer it doesn’t give this error