2014-09-05 54 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, 

})區`

相關問題