简体   繁体   English

如何在Netbeans或其他IDE中运行javascript测试代码?

[英]How do I run javascript test code in Netbeans or other IDE?

I am a bit of a Javascript noob, and I have been mostly doing my coding through Codecademy or CodeSchool where you just type in your code, hit Run, and the website lets you know if you're wrong or right. 我有点像Java语言的菜鸟,而且我大部分时间都是通过Codecademy或CodeSchool进行编码的,您只需键入代码,然后单击Run,然后网站就会告诉您是对还是错。 I'm now working with Free Code Camp, and they have these challenges where I can plug in the code, but it does not give me error messages or lets me know if I'm missing semicolons or if I just want to test a section of code at a time as I build it, etc. I am used to using an IDE for things like this for Java or Toad for SQL, but I found that NetBeans doesn't have anything where I can just dump code, compile it, run it, and see the end results. 我现在正在使用Free Code Camp,他们在插入代码时遇到了这些挑战,但是它不会给我错误消息,也不会让我知道我是否缺少分号或只是想测试一个部分每次编译时都会生成大量代码,等等。我习惯将IDE用于Java或Toad用于SQL,但我发现NetBeans没有什么地方可以直接转储代码,对其进行编译,运行它,然后查看最终结果。 I tried Chrome Dev Tools, but it seems like there is a Javascript console, but nothing where I can write code and run it from there...unless I am totally mistaken, which is what I would like to know. 我尝试使用Chrome Dev Tools,但似乎没有Java控制台,但是没有什么地方可以编写代码并从那里运行它...除非我完全误解了,这是我想知道的。 :) If someone could let me know how to do this, that would be greatly appreciated. :)如果有人可以让我知道如何执行此操作,将不胜感激。

Thank you! 谢谢!

Perdue 珀杜

Check out this post . 看看这个帖子

You can use any of the following: 您可以使用以下任何一种:

  1. JSFiddle JSFiddle
  2. CodePen 密码笔
  3. CSS Deck CSS甲板
  4. JS Bin JS斌
  5. Dabblet 达伯特
  6. Liveweave 活织

In Chrome Dev Tools you can paste or write code code in the console and run it, basically it's just like Code School prompt. 在Chrome开发工具中,您可以在控制台中粘贴或编写代码,然后运行它,基本上就像是代码学校提示。 It can also identify your errors and show them. 它还可以识别您的错误并显示出来。

Just press F12 to open the console. 只需按F12键即可打开控制台。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM