html代码
代码如下 | 复制代码 |
<textarea name="content" id="content"> 这里放你要运行js,html代码 </textarea> <input type="button" name="Submit" value="运行代码" onclick="runCode('content')"/> |
js代码
代码如下 | 复制代码 |
<script> var lang = new Array(); var userAgent = navigator.userAgent.toLowerCase(); var is_opera = userAgent.indexOf('opera') != -1 && opera.version(); var is_moz = (navigator.product == 'Gecko') && userAgent.substr(userAgent.indexOf('firefox') + 8, 3); var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera) && userAgent.substr(userAgent.indexOf('msie') + 5, 3); Array.prototype.push = function(value) { function oCopy(objname){ </script> |