W3Schools试用编辑器 [英] W3Schools Try-it Editor
本文介绍了W3Schools试用编辑器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道关于我需要像这样的编辑器,因此在键入js/html/css时,代码会被接受并像tryit编辑器一样显示.
I need an editor like it, so when typing js/html/css the code be accepted and shown like the tryit editor.
推荐答案
您所指的编辑器"不过是:
The "editor" you are referring to is nothing more but:
<form action="<?= $_SERVER["PHP_SELF"] ?>" method="POST">
<input type="submit">
<textarea name="code"><?= htmlentities($_POST["code"]) ?></textarea>
<div id="output">
<?= $_POST["code"] ?>
</div>
PHP表单发送甚至可以替换为:
And the PHP form sending could even be replaced by:
<button onclick='$("#output").html( $("textarea#code").value )'>
这篇关于W3Schools试用编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文