如何创建在线javascript编辑器? [英] how to create a online javascript editor?

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

问题描述

我正在学习javascript,但是做一些实验不太方便。您必须创建一个模板HTML文件,然后将您的js代码嵌入其中,然后使用浏览器打开html文件。即使你只想看 alert(hello world)。我想知道创建一个在线javascript编辑器是否容易。基本思想是:在html文本区域中,你只需直接输入js代码,它下面有一个按钮Run来运行js代码。如果它包含一些语法错误,可能会显示错误消息。例如:某人已经创建了这样的人: http://www.codehouse.com/webmaster_tools/javascript_editor/

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 js code into it, and then use browser to open the html file. Even you just want to see alert("hello world"). I wonder if it's easy to create a online javascript editor. The basic idea is: in a html text-area, you just type in js code directly, it has one button "Run" below to run the js code. 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/

我想知道如何创建这个?是否有任何材料,博客等..如何创建这个?谢谢!

I wonder how to create this? Is there any materials, blog etc.. on how to create this? Thanks!

推荐答案

您是否考虑过 http ://jsbin.com ?它已经配备了各种版本的最着名的javascript框架进行测试。此外,它会在线存储您的代码并创建一个简短的URL,以便您可以传递示例,并快速返回之前感兴趣的项目。你会看到我们这里经常使用它来互相帮助。

Have you considered http://jsbin.com? It's already equiped 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天全站免登陆