Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为什么不 console.log('hello'); 在 JSfiddle 中输出任何内容。我只问是因为它告诉我不要使用 document.write(); 我不知道还能用什么来输出我的数据。有谁知道输出数据的正确方法?
您可以随时使用警报,也可以将信息插入页面上的 html
编辑:抱歉误读了这个问题,但这些仍然是查看数据的有效方式......
控制台写入文字浏览器控制台。在 chrome hit tools > Javascript 控制台
Firefox 和 IE 中的类似步骤
编辑:
另外,我知道这可能是不好的做法,但我确实懒得一直看控制台,所以我通常最终创建一个调试 div 并将文本附加到它.. /shameless