本文介绍了IBM工作灯6.1 - 未捕获ReferenceErrors:没有定义WLJQ,WL没有定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用安装在Eclipse朱诺作为我的IDE和backbonejs为我的项目我的主要JavaScript框架,IBM工作灯开发版6.1。

I'm using IBM Worklight Developer Edition 6.1 installed in Eclipse Juno as my IDE and backbonejs as my main javascript framework for my project.

我的index.html

<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
    <script>window.$ = window.jQuery = WLJQ;</script>

    <script data-main="js/main" src="js/libs/require/require.js"></script>
</head>
<body>

</body>
</html>

我的main.js

require.config({
    paths: {
        jquery: 'libs/jquery/jquery-min',
        underscore: 'libs/underscore/underscore-min',
        backbone: 'libs/backbone/backbone-min',
        templates: '../templates',
        bootstrap: 'bootstrap.min',
        initOptions: 'initOptions',
        biiRibMobile: 'biiRibMobile',
        messages: 'messages'
    },
});
require(['app', ], function(App) {
    App.initialize();
});

我的app.js

// Filename: app.js
define(['jquery', 'underscore', 'backbone', 'router', // Request router.js
'bootstrap', 'initOptions', 'biiRibMobile', 'messages', ], function($, _, Backbone, Router, bootstrap, initOptions, biiRibMobile, messages) {
    var initialize = function() {
            // Pass in our Router module and call it's initialize function
            Router.initialize();
        };
    return {
        initialize: initialize
    };
});

我的initOptions.js

var wlInitOptions = {

    logger : {enabled: true, level: 'debug', stringify: true, pretty: false,
        tag: {level: false, pkg: true}, whitelist: [], blacklist: []},

    analytics : {
        enabled: false
        //url : ''
    }

};

if (window.addEventListener) {
    window.addEventListener('load', function() { WL.Client.init(wlInitOptions); }, false);
} else if (window.attachEvent) {
    window.attachEvent('onload',  function() { WL.Client.init(wlInitOptions); });
}

非常感谢在前进。

Thanks a lot in advance.

推荐答案

@DavidDhuyveter在评论一个很好的答案。我在Mac和Windows PC上这个问题。他的回答固定我的Mac问题。

@DavidDhuyveter has a good answer in the comments. I had this problem on a Mac and on a Windows PC. His answer fixed my Mac issues.

对于Windows,临时文件夹应该在/用户/您/应用程序数据/本地/温度/ 1 /或类似的规定。

For Windows, the temp folder should be in /Users/you/AppData/Local/Temp/1/ or something along those lines.

修改
大卫评论被删除。这是原来的:

EDITDavid comments were deleted. This is the original:

如果你是在Mac上,请执行下列操作:退出蚀。打开一个终端窗口和CD $ TMPDIR,室射频wlBuildResources WL preVIEW,重新启动Eclipse,重建您的应用程序,你应该是好去 -

这篇关于IBM工作灯6.1 - 未捕获ReferenceErrors:没有定义WLJQ,WL没有定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 06:39