404 Not Found在骨干路由器中配置视图

时间:2014-03-18 07:33:50

标签: backbone.js requirejs

这是我项目的结构

enter image description here

然后我在路由器中配置:

define([
    'jquery',
    'backbone',
    'router',
    'views/Service/Service'
], function($,
        Backbone,
        Router,
        Service

这是main.js

requirejs.config({
enforceDefine: true,
paths: {
    "webconfig" : "libs/scripts/WebConfig",
    "jquery": "libs/jquery/jquery-min",
    "underscore": "libs/underscore/underscore-min",
    "backbone": "libs/backbone/backbone-min",
    "localStorage" : "libs/backbone/backbone.localStorage-min",
    "reveal":"libs/jquery/jquery.reveal",
    "jquery.pnotify" : "libs/jquery/jquery.pnotify.min",
    "text" : "text",
    "ice" : "libs/scripts/ice",
    "cart" : "libs/scripts/Cart",
    "wishlist" : "libs/scripts/WishList",
    "user" : "libs/scripts/Customer",
    "content" : "libs/scripts/Content",
    "item" : "libs/scripts/Item",
    "service" : "libs/scripts/Service",
    "rewardcart" : "libs/scripts/RewardCart",
    "recentlyviewed" : "libs/scripts/RecentlyView",
    "msgbox" : "libs/scripts/msgbox",
    "navigator" : "libs/scripts/Navigator",
    "quotation" : "libs/scripts/Quotation",
    "websitetracking" : "libs/scripts/WebsiteTracking",
    "select2" : "libs/jquery/select2",
    "jquery-menu-aim" : "libs/jquery/jquery.menu-aim",
    "bootstrap" : "libs/jquery/bootstrap.min",
    "jssor" : "libs/jquery/jssor.slider.min"

},
shim: {
    "webconfig" : {
        exports : "forMainRequireJS"
    },
    "underscore": {
        deps: [],
        exports: "_"
    },
    "backbone": {
        deps: ["jquery", "underscore"],
        exports: "Backbone"
    },
    "reveal": {
        deps: ["jquery"],
        exports: "jQuery.fn.reveal"
    },
    'jquery.pnotify': ["jquery"],
    "ice" : {
        //deps: ["jquery"],
        exports: "getItemIndexById"
    },
    "cart"  : {
        exports : "Cart"
    },
    "wishlist"  : {
        exports : "WishList"
    },
    "user"  : {
        exports : "Customer"
    },
    "item" : {
        exports : "Item"
    },
    "content" : {
        exports : "Content"
    },
    "service" : {
        exports : "Service"
    },
    "rewardcart" : {
        exports : "RewardCart"
    },
    "recentlyviewed" : {
        exports : "RecentlyView"
    },
    "msgbox" : {
        exports : "messageBox"
    },
    "navigator" : {
        exports : "Navigator"
    },
    "quotation" : {
        exports : "Quotation"
    },
    "websitetracking" : {
        exports : "WebsiteTracking"
    },
    "select2" : {
        exports : "Select2"
    },
    "jquery-menu-aim" : {
        deps: ["jquery"] ,
        exports: "jQuery.fn.menuAim"
    },
    "bootstrap": {
        deps: ["jquery"],
        exports: "jQuery.fn.popover"
    },
    "jssor" : {
        exports : "$JssorSlider$"
    }
}
});

define(["app"] , function(App){
   App.initialize();
});

我收到NetworkError: 404 Not Found - http://localhost/source/webcore/Service.js"错误。

我在这里错了什么?

感谢您的回答。

0 个答案:

没有答案