簡體   English   中英

Require.js Ace編輯器腳本錯誤

[英]Require.js ace editor script errors

我正在執行以下操作:

<script src="/js/lib/require.js" data-main="/js/app"></script>

app.js

requirejs.config({
    "baseUrl": "/js/lib",
    "paths": {
        "app": "../app",
        "jquery": "//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min",
        "ace": "ace"
    }
});

// Load the main app module to start the app
requirejs(["app/main"]);

main.js

define(["jquery", "ace/ace"], function($, ace){

    $(document).ready(function(){
        var editor = ace.edit("editor-ace");
        editor.getSession().setMode("ace/mode/html");
    });
});

看來工作正常,我看到帶有語法高亮顯示的ace編輯器。

但是,當我查看javascript錯誤日志時,會看到很多類似這樣的條目...

Script error for: ace/edit_session
Script error for: ace/undomanager

等等..

有人可以指出我要去哪里了嗎(require.js我很新)?

看來您使用的是打包版本,這是一個已知的錯誤https://github.com/ajaxorg/ace-builds/issues/35,原因是來自https://groups.google.com/d的定義調用順序錯誤/ msg / ace-discuss / w6WlAmR0SH4 / 6tdtlMhnY40J似乎應該盡快修復。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM