Reputation: 11
We have been using WaveMaker and wanted to know how we can go about importing an external javascript file using the platform ?
Upvotes: 1
Views: 340
Reputation: 1802
The following works if using WaveMaker 6. This probably doesn't work with newer versions of WaveMaker.
Instead of having to add it to each project, try editing index.html
in the webapproot
directory and add you external js file:
<!-- Boot Wavemaker -->
<script type="text/javascript" src="config.js"></script>
<script type="text/javascript" src="/<path to javascript file>/sha512.js"></script>
Then, in order to have this work correctly in your development environment, add a context tag to server.xml
just above the projects directory:
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">
<Context docBase="c:/<Path To Javascript Filet" path="<path to javascript file matching whats in index.html>" reloadable="true"/>
</Host>
In the above Context
tag, docBase
is the local folder with js and path
should match the path placed in index.html
.
Doing this you can use the javascript file across all projects without having to add it to resources
in the project.
Upvotes: 0
Reputation: 21
Upvotes: 2