0
私はHTMLやCSSなどを使い慣れていますが、私は何かを学ぶプロジェクトに取り組んできました。iFrameのHTMLエディタで構文の強調表示
iFrameオブジェクトに埋め込まれたHTMLエディタを作成しようとしています。これまでのところ働いていましたが、今では私には非常に素晴らしい構文ヒントを使ったエディタを見ました。
どうすればできますか? (!!関連):
<div>
<div id="button">
<input onclick="runCode();" type="button" value="Speichern und Abschicken">
</div>
<td>
<form>
<textarea name="sourceCode" id="sourceCode">
<strong> Change me! </strong>
</textarea>
</form>
</td>
<iframe name="targetCode" id="targetCode"></iframe>
</tr>
編集:ここ
は私のコード今のところはあるJS
function runCode()
{
var content = document.getElementById('sourceCode').value;
var iframe = document.getElementById('targetCode');
iframe = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument;
iframe.document.open();
iframe.document.write(content);
iframe.document.close();
return false;
}
runCode();
は私がやっているなら、私に教えてください忘れてしまいましたここで何か間違っている、私はそれを説明するようにしようとしました。
ありがとう、tho私は前に両方を試みた。しかし、私はリンクを見て、それが私に役立つかどうかを教えてくれるでしょう:) –