`

我的测试工具

 
阅读更多
<html>
<head>

</head>
<body>
<!-- 一个方便测试js代码的html元素 -->
<textarea id='codeTextarea' style='width:500px;height:100px'>document.getElementById("showTextarea").value = navigator.language || navigator.browserLanguage;</textarea><br/>
<input type='button' value='test' onclick='eval(document.getElementById("codeTextarea").value);' /><br/>
<textarea id='showTextarea' style='width:500px;height:100px'></textarea>

<!-- 在不方便调试的js环境下使用,例如单机版;将网页内容放到iframe中,网页可以调用top.log()-->
<script>
//top.log('123');
function log(message){
document.getElementById('showTextarea').value += '\n' + message;
}
</script>
<br/>
<iframe id='iframe' style="border:1px solid;width:1000px;height:500px;"></iframe>

<!--
一些常用的测试js代码
document.getElementById("showTextarea").value = navigator.language || navigator.browserLanguage;
showTextarea.value = iframe.contentDocument.body.innerHTML;
-->
</body>
</html>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics