<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>在线运行JavaScript - JavaScript乐园</title>
<meta name="keywords" content="在线运行javascript" />
<script language="JavaScript" type="text/JavaScript">
<!--
function runJs(s) {
var codeArea = document.getElementById(s);
var code = codeArea.value;
if (code!=""){
var newwin=window.open('','','');
newwin.opener = null;
newwin.document.write(code);
newwin.document.close();
}
}
//-->
</script>
</head>
<body>
<textarea cols="100" rows="25" id="c"></textarea>
<br><input onclick="runJs('c')" type="button" value="运行代码" /> <input onclick="document.getElementById('c').value='';" type="button" value="清空代码" />
</body>
</html>
本文介绍了一个简单的在线JavaScript代码运行工具。用户可以在文本框内输入JavaScript代码,并通过点击按钮在新窗口中运行。此工具适用于快速测试JavaScript代码片段,无需设置本地开发环境。
993

被折叠的 条评论
为什么被折叠?



