2014-09-05 134 views
-1

我不知道预先保存的HTML文件是否可以在Ace Editor中打开。这可能吗?我可以在Ace Editor中打开HTML文件吗?

事实上,我想在Ace编辑器中加载预存的HTML文件,以便可以在编辑器中查看文件的代码。

请告诉我如何做到这一点。

+0

是的,为什么不呢?因为它为开发人员构建。他们提到*超过110种语言的语法高亮显示(TextMate/Sublime Text.tmlanguage文件可导入)* [here ..](http://ace.c9.io/#nav=about) – 2014-09-05 11:07:58

+0

请参阅http:// stackoverflow.com/questions/25463106/how-to-save-or-edit-javascript-files-in-ace-editor/25466796#25466796 – 2014-09-06 08:21:17

回答

0

我知道了。我用PHP来做到这一点。

<div id="editor"> 
<?php echo htmlentities(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "html_file_address_here"));?> 
</div> 
-1

是u能做到这一点

`VAR编辑= ace.edit( 'left_main_content'); //用HTML ...或尝试其父

editor.setOptions({ 
    theme: "ace/theme/dawn",  
    mode: "ace/mode/html", 
    setUseWrapMode: true, 

})区`

相关问题