Uncaught ReferenceError: wlInitOptions is not defined

别等时光非礼了梦想. 提交于 2019-11-28 14:52:11

Look inside your application's js folder (yourProject\apps\yourApp\common\js). Make sure it contains an initOptions.js file and that its content is as follows (you can also create a new application and copy the file from there):

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); });

In addition, the HTML file must not contain a call to WL.Client.init in the <body> tag. It should look like this:

<body id="content" style="display: none;">
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!