且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Ace编辑器中启用实时语法检查

更新时间:2023-02-04 19:11:49

语法检查是通过加载 http://www.learneroo.com/assets/ace-src/worker-javascript。 js 文件,但在您的网站中该文件似乎是空的。我只在其中看到;

在之前显示的jsfiddle http://jsbin.com/ojijeb/432/edit ,由于对网络工作者的交叉原始限制(因为运行chrome时我没注意到)所以它无效使用 - disable-web-security ),但是由于最新的Ace更新,它现在可以使用。

Syntax checking is done via webworker which loads http://www.learneroo.com/assets/ace-src/worker-javascript.js file, but in your site that file seems to be empty. I only see ; in it.
In the jsfiddle i showed earlier http://jsbin.com/ojijeb/432/edit, it didn't work because of cross origin restrictions on web workers (which i didn't notice since was running chrome with --disable-web-security), but thanks to latest Ace update, it works now.