Ace stopped working in some cases

646 views
Skip to first unread message

Umur Ozkul

unread,
May 5, 2015, 11:49:40 AM5/5/15
to ace-d...@googlegroups.com
<script src="/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
    var editor = ace.edit("editor");
    editor.setTheme("ace/theme/monokai");
    editor.getSession().setMode("ace/mode/javascript");
</script>

This was working correctly for the last 2 years.

Today I started getting
    Uncaught ReferenceError: ace is not defined

This is happening on Firefox and Chrome. While in Safari the code continues to work.

Any ideas?

PS. Of course, other js in the site might be the cause but while they are coming from the site ace is the only one coming externally. So I cannot blame changes in my js.

Harutyun Amirjanyan

unread,
May 5, 2015, 11:58:21 AM5/5/15
to ace-d...@googlegroups.com
> <script src="/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
> ace is the only one coming externally

"/ace-builds/src-noconflict/ace.js" doesn't look lile external, did you update /ace-builds?
link to the site or demo page would be helpful.

Umur Ozkul

unread,
May 6, 2015, 9:35:11 AM5/6/15
to ace-d...@googlegroups.com
        <script src="http://ajaxorg.github.io/ace-builds/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>

Sorry. Wrong paste. Above are the script references.

Working site is https://stage-www.publitory.com . You need to create a book on desk and press <html> toolbutton on the editor.

Reminder. It's still working on Safari. Chrome fails.

Harutyun Amirjanyan

unread,
May 6, 2015, 12:43:44 PM5/6/15
to ace-d...@googlegroups.com
chrome blocks pages with mixed content so you can't load a script from http:// on https:// page

you can use http://www.jsdelivr.com/#!ace to get version you want

Umur Ozkul

unread,
May 11, 2015, 12:03:28 AM5/11/15
to ace-d...@googlegroups.com
Thanks. This fixes the problem:

<script src="https://ajaxorg.github.io/ace-builds/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="https://ajaxorg.github.io/ace-builds/src-min-noconflict/mode-xml.js"></script>
Reply all
Reply to author
Forward
0 new messages