我们一直在使用WaveMaker,想知道如何使用该平台导入外部javascript文件?
发布于 2016-03-01 18:35:03
发布于 2016-03-10 03:54:39
如果使用的是WaveMaker 6,则可以执行以下操作。这可能不适用于较新版本的WaveMaker。
您可以尝试在webapproot目录中编辑index.html并添加外部js文件,而不必将其添加到每个项目中:
<!-- Boot Wavemaker -->
<script type="text/javascript" src="config.js"></script>
<script type="text/javascript" src="/<path to javascript file>/sha512.js"></script>然后,为了让它在您的开发环境中正常工作,向项目目录上方的server.xml添加一个上下文标记:
<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>在上面的Context标记中,docBase是包含js的本地文件夹,path应该与index.html中的路径相匹配。
这样,您就可以在所有项目中使用javascript文件,而不必将其添加到项目中的resources。
https://stackoverflow.com/questions/35625208
复制相似问题