如何创建在线JavaScript编辑器? [英] How can I create an online JavaScript editor?

查看:58
本文介绍了如何创建在线JavaScript编辑器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习JavaScript.但是,进行一些实验并不是很方便.您必须先创建一个模板HTML文件,然后将您的JavaScript代码嵌入其中,然后使用浏览器打开HTML文件,即使您只想查看 alert("hello world").

I'm learning JavaScript. However, it's not so convenient to do some experiments. You have to create a template HTML file and then embed your JavaScript code into it, and then use a browser to open the HTML file, even you just want to see alert("hello world").

我想知道创建在线JavaScript编辑器是否容易.基本思想是:在HTML文本区域中,您只需直接输入JavaScript代码,然后在下面有一个按钮运行"即可运行JavaScript代码.

I wonder if it's easy to create an online JavaScript editor. The basic idea is: in a HTML text-area, you just type in JavaScript code directly, and it has one button, "Run", below to run the JavaScript code.

如果它包含一些语法错误,则可能显示错误消息.例如:某人已经创建了这样的文件: http://www.codehouse.com/webmaster_tools/javascript_editor/

If it contains some syntax errors, maybe show the error message out. For example: someone already created one like this: http://www.codehouse.com/webmaster_tools/javascript_editor/

如何创建它?是否有任何有关如何创建此内容的材料,博客等?

How can I create this? Are there any materials, blog, etc. on how to create this?

推荐答案

考虑 http://jsbin.com .它已经配备了用于测试的最杰出的JavaScript框架的各种版本.此外,它在线存储您的代码并创建一个短URL,以便您可以传递示例,并快速参考以前感兴趣的项目.您会在这里看到我们很多人经常使用它来互相帮助.

Consider http://jsbin.com. It's already equipped with various versions of the most prominent JavaScript frameworks for testing. Furthermore, it stores your code online and creates a short-URL so you can pass examples around, and quickly refer back to previous items of interest. You'll see many of us here using it frequently to help each other.

如果您真的想自己工作,可以在GitHub上分叉jsbin: http://github.com/remy/jsbin

If you really want to work on your own, you can fork jsbin on GitHub: http://github.com/remy/jsbin

这篇关于如何创建在线JavaScript编辑器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆