自从我将worklight开发人员版升级到v5.0.6后,我收到此错误:
wlclient init started worklight.js:1118
Uncaught ReferenceError: wlInitOptions is not defined
答案 0 :(得分:2)
查看应用程序的js文件夹(yourProject \ apps \ yourApp \ common \ js)。确保它包含一个initOptions.js文件,其内容如下(您还可以创建一个新的应用程序并从那里复制该文件):
var wlInitOptions = {
// # Should application automatically attempt to connect to Worklight Server on application start up
// # The default value is true, we are overriding it to false here.
connectOnStartup : false
};
if (window.addEventListener) {
window.addEventListener('load', function() { WL.Client.init(wlInitOptions); }, false);
} else if (window.attachEvent) {
window.attachEvent('onload', function() { WL.Client.init(wlInitOptions); });
此外,HTML文件不得包含<body>
标记中对WL.Client.init的调用。它应该是这样的:
<body id="content" style="display: none;">