You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

clientsideapp-loading.asciidoc 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ---
  2. title: Loading a Client-Side Application
  3. order: 4
  4. layout: page
  5. ---
  6. [[clientsideapp.loading]]
  7. = Loading a Client-Side Application
  8. You can load the JavaScript code of a client-side application in an HTML __host
  9. page__ by including it with a [literal]#++<script>++# tag, for example as
  10. follows:
  11. [source, html]
  12. ----
  13. <html xmlns="http://www.w3.org/1999/xhtml">
  14. <head>
  15. <meta http-equiv="Content-Type"
  16. content="text/html; charset=UTF-8" />
  17. <title>Embedding a Vaadin Application in HTML Page</title>
  18. <!-- Load the Vaadin style sheet -->
  19. <link rel="stylesheet"
  20. type="text/css"
  21. href="/myproject/VAADIN/themes/reindeer/legacy-styles.css"/>
  22. </head>
  23. <body>
  24. <h1>A Pure Client-Side Application</h1>
  25. <script type="text/javascript" language="javascript"
  26. src="clientside/com.example.myapp.MyModule/
  27. com.example.myapp.MyModule.nocache.js">
  28. </script>
  29. </body>
  30. </html>
  31. ----
  32. The JavaScript module is loaded in a [literal]#++<script>++# element. The
  33. [literal]#++src++# parameter should be a relative link from the host page to the
  34. compiled JavaScript module.
  35. If the application uses any supplementary Vaadin widgets, and not just core GWT
  36. widgets, you need to include the Vaadin theme as was done in the example. The
  37. exact path to the style file depends on your project structure - the example is
  38. given for a regular Vaadin application where themes are contained in the
  39. [filename]#VAADIN# folder in the WAR.
  40. In addition to CSS and scripts, you can load any other resources needed by the
  41. client-side application in the host page.