久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='3H0cr'><style id='3H0cr'><dir id='3H0cr'><q id='3H0cr'></q></dir></style></legend>

<small id='3H0cr'></small><noframes id='3H0cr'>

    <i id='3H0cr'><tr id='3H0cr'><dt id='3H0cr'><q id='3H0cr'><span id='3H0cr'><b id='3H0cr'><form id='3H0cr'><ins id='3H0cr'></ins><ul id='3H0cr'></ul><sub id='3H0cr'></sub></form><legend id='3H0cr'></legend><bdo id='3H0cr'><pre id='3H0cr'><center id='3H0cr'></center></pre></bdo></b><th id='3H0cr'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='3H0cr'><tfoot id='3H0cr'></tfoot><dl id='3H0cr'><fieldset id='3H0cr'></fieldset></dl></div>

      <bdo id='3H0cr'></bdo><ul id='3H0cr'></ul>
    <tfoot id='3H0cr'></tfoot>

    1. router.js 函數(shù)未執(zhí)行

      router.js Function not executed(router.js 函數(shù)未執(zhí)行)

          • <i id='P0cP7'><tr id='P0cP7'><dt id='P0cP7'><q id='P0cP7'><span id='P0cP7'><b id='P0cP7'><form id='P0cP7'><ins id='P0cP7'></ins><ul id='P0cP7'></ul><sub id='P0cP7'></sub></form><legend id='P0cP7'></legend><bdo id='P0cP7'><pre id='P0cP7'><center id='P0cP7'></center></pre></bdo></b><th id='P0cP7'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='P0cP7'><tfoot id='P0cP7'></tfoot><dl id='P0cP7'><fieldset id='P0cP7'></fieldset></dl></div>
              <tbody id='P0cP7'></tbody>
              <legend id='P0cP7'><style id='P0cP7'><dir id='P0cP7'><q id='P0cP7'></q></dir></style></legend><tfoot id='P0cP7'></tfoot>

              <small id='P0cP7'></small><noframes id='P0cP7'>

                <bdo id='P0cP7'></bdo><ul id='P0cP7'></ul>

              • 本文介紹了router.js 函數(shù)未執(zhí)行的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                <塊引用>

                //文件名:router.jsconsole.log('測(cè)試路線');定義(['jquery','下劃線','骨干','視圖/工作/列表'], 函數(shù)($, _, Backbone, JobListView){var AppRouter = Backbone.Router.extend({路線:{//定義一些 URL 路由'/dalo??/jobs': 'showJobs',//默認(rèn)'*actions': 'defaultAction'}});var 初始化 = 函數(shù)(){var app_router = 新的 AppRouter;app_router.on('route:showJobs', function(){//在我們通過依賴數(shù)組加載的模塊上調(diào)用渲染//'視圖/工作/列表'console.log('顯示作業(yè)路徑');var jobListView = new JobListView();jobListView.render();});app_router.on('defaultAction', function(actions){//我們沒有匹配的路由,讓我們記錄一下 URL 是什么console.log('No route:', actions);});Backbone.history.start();};返回 {初始化:初始化};});

                我的 main.js 的一部分,我沒有使用 NEW,因?yàn)樗o出了一個(gè)問題,說它不是一個(gè)函數(shù),不確定它是否與上面的錯(cuò)誤有關(guān)

                require(['app'], function(AppView){AppView.initialize();});

                我在 Router.initialize() 之后做了一個(gè) console.Log;在 app.js ,它可以顯示.我還在這個(gè)應(yīng)用程序 router.js 上面一直做了一個(gè)控制臺(tái)日志,它也顯示,除此之外,它沒有顯示函數(shù)內(nèi)部的任何內(nèi)容.

                控制臺(tái)只顯示 2 個(gè)控制臺(tái)日志(在 Route.Initialize 之后 & 在 router.js 定義之前

                有什么建議嗎?我正在使用 http://backbonetutorials.com/organizing-backbone-using-modules/

                我的 App.js

                define(['jquery','下劃線','骨干','router',//請(qǐng)求 router.js], 函數(shù)($, _, Backbone, Router){var 初始化 = 函數(shù)(){//傳入我們的路由器模塊并調(diào)用它的初始化函數(shù)路由器初始化();console.log('路由器初始化');}返回 {初始化:初始化};});

                解決方案

                可能您使用的是 非 AMD 版本的 Backbone.js 和 Underscore.js.

                通過這種方式,您必須將所謂的墊片"添加到您的主/配置文件中.

                <塊引用>

                shim:為較舊的傳統(tǒng)瀏覽器全局變量"腳本配置依賴項(xiàng)、導(dǎo)出和自定義初始化,這些腳本不使用 define() 來聲明依賴項(xiàng)并設(shè)置模塊值.http://requirejs.org/docs/api.html#config-shim

                正如您所看到的,設(shè)置依賴項(xiàng)并導(dǎo)出您的庫,以便您在腳本中使用它.

                因此,在您的主/配置文件中,在路徑之后嘗試添加此墊片部分:

                路徑:{...},墊片:{'主干':{deps: ['jquery','underscore'],出口:骨干"}}

                現(xiàn)在我想你可以繼續(xù)......

                // Filename: router.js
                console.log('TEST ROUTE');
                define([
                    'jquery',
                    'underscore',
                    'backbone',
                    'views/jobs/list'
                ], function($, _, Backbone, JobListView){
                    var AppRouter = Backbone.Router.extend({
                        routes: {
                            // Define some URL routes
                            '/dalo/jobs': 'showJobs',
                
                            // Default
                            '*actions': 'defaultAction'
                        }
                    });
                
                    var initialize = function(){
                        var app_router = new AppRouter;
                        app_router.on('route:showJobs', function(){
                            // Call render on the module we loaded in via the dependency array
                            // 'views/jobs/list'
                            console.log('Show Job Route');
                            var jobListView = new JobListView();
                            jobListView.render();
                
                        });
                
                        app_router.on('defaultAction', function(actions){
                            // We have no matching route, lets just log what the URL was
                            console.log('No route:', actions);
                        });
                        Backbone.history.start();
                    };
                    return {
                        initialize: initialize
                    };
                });
                

                Part of my main.js , i didnt use NEW because it gave issues saying it's not a function not sure if it's related to the error above

                require(['app'], function(AppView){
                    AppView.initialize();
                });
                

                I did a console.Log after Router.initialize(); at app.js , it can show. I also did a console log all the way above in this app router.js it's also showing, other than that , it doesnt show anything inside the function.

                The console is only showing that 2 console Log (After Route.Initialize & Before router.js define

                Any advice? I'm using http://backbonetutorials.com/organizing-backbone-using-modules/

                My App.js

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

                解決方案

                Probably you're using a non-AMD version of Backbone.js and Underscore.js.

                This way you've to add what it's called a "shim" to your main/config file.

                shim: Configure the dependencies, exports, and custom initialization for older, traditional "browser globals" scripts that do not use define() to declare the dependencies and set a module value. http://requirejs.org/docs/api.html#config-shim

                As you can see this set dependencies and export your lib in order to let you using it in your scripts.

                So, in your main/config file, after the paths try adding this shim part:

                paths: {
                    ...
                },
                shim: {
                    'backbone': {
                        deps: ['jquery','underscore'],
                        exports: 'Backbone'
                    }
                }   
                

                Now I suppose you could proceed ...

                這篇關(guān)于router.js 函數(shù)未執(zhí)行的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動(dòng)游標(biāo)不起作用)
                PHP PDO ODBC connection(PHP PDO ODBC 連接)
                Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個(gè)值;等于變量的值)
                MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動(dòng)程序)
              • <small id='npCAJ'></small><noframes id='npCAJ'>

                  <i id='npCAJ'><tr id='npCAJ'><dt id='npCAJ'><q id='npCAJ'><span id='npCAJ'><b id='npCAJ'><form id='npCAJ'><ins id='npCAJ'></ins><ul id='npCAJ'></ul><sub id='npCAJ'></sub></form><legend id='npCAJ'></legend><bdo id='npCAJ'><pre id='npCAJ'><center id='npCAJ'></center></pre></bdo></b><th id='npCAJ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='npCAJ'><tfoot id='npCAJ'></tfoot><dl id='npCAJ'><fieldset id='npCAJ'></fieldset></dl></div>
                  <tfoot id='npCAJ'></tfoot>

                      <bdo id='npCAJ'></bdo><ul id='npCAJ'></ul>
                        <tbody id='npCAJ'></tbody>

                        1. <legend id='npCAJ'><style id='npCAJ'><dir id='npCAJ'><q id='npCAJ'></q></dir></style></legend>

                          主站蜘蛛池模板: 精品久久久久久久 | 一级片在线免费播放 | 亚洲国产欧美一区二区三区久久 | 国产精品99久久久久久久久久久久 | 亚洲色片网站 | 婷婷久久五月天 | 亚洲传媒在线 | 精品久久久久久亚洲国产800 | 在线天堂免费中文字幕视频 | 久久久一区二区三区 | 成人亚洲综合 | 国产一区二区三区亚洲 | 91精品久久久 | 天天久久| 亚洲少妇综合网 | 精品视频一区二区三区在线观看 | 国产精品18久久久久久久 | 91免费福利视频 | 久草.com| 国产91丝袜在线熟 | 久久久久久久亚洲精品 | 日本一区二区电影 | 欧美日韩精品 | 欧美激情啪啪 | 中国一级特黄真人毛片免费观看 | 欧美日韩精品中文字幕 | 久久久入口| 欧美一级大片免费看 | 欧美成人一区二区 | 日韩欧美一二三区 | 亚洲成人在线免费 | 天天天天天操 | 亚洲国产情侣自拍 | 亚洲二区在线 | 欧美日韩一区二区三区视频 | 日韩欧美在线观看视频 | 久久免费精品 | 亚洲午夜在线 | 亚洲经典一区 | 国产区在线免费观看 | 黄网免费 |