Gol*_*lem 5 html javascript eclipse
我只想和JS一起玩.我想使用没有HTML或HTML页面的JS - 只是一个输出控制台.什么是最好的方式?我有这个:
<html>
<body>
<h1>Playin around</h1>
<script type="text/javascript" src="script.js"></script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
的script.js:
var test = "global";
function out() {
var test = "local";
return test;
}
window.alert(out());
Run Code Online (Sandbox Code Playgroud)
如何替换window.alert以便我可以获得控制台输出以及如何制作"主要"或其他东西,我不必从HTML开始?
谢谢
最简单的解决方案是安装 FireBug for Firefox,然后使用控制台:
console.log(out());
Run Code Online (Sandbox Code Playgroud)