NetBeans Javascript?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7592171/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 02:50:45  来源:igfitidea点击:

NetBeans Javascript?

javascriptnetbeans

提问by Shannon Rothe

I just downloaded Netbeans because I read another question saying it's a good IDE to develop Javascript with. I tried making a new project, but there is no option to set it to Javascript.

我刚刚下载了 Netbeans,因为我读了另一个问题,说它是一个很好的 IDE 来开发 Javascript。我尝试创建一个新项目,但没有将其设置为 Javascript 的选项。

If anyone knows how to set it up to develop with Javascript, please leave a reply. I will be much appreciative.

如果有人知道如何设置它以使用Javascript进行开发,请留下回复。我将不胜感激。

Thanks.

谢谢。

回答by c69

Update:

更新:

NetBeans 7.4Released in October 2013, builds on the functionality listed below. As well as direct download of most major JS source files from CDNJS. Version 7.4 includes "Editing support for AngularJS, Knockout and ExtJS frameworks, Navigator and code folding in JSON files, Enhanced code completion with improved accuracy" see more here: https://netbeans.org/community/releases/74/

NetBeans 7.4于 2013 年 10 月发布,以下列功能为基础。以及从 CDNJS 直接下载大多数主要 JS 源文件。7.4 版包括“对 AngularJS、Knockout 和 ExtJS 框架的编辑支持、JSON 文件中的导航器和代码折叠、增强的代码完成并提高准确性”,请参见此处的更多信息:https: //netbeans.org/community/releases/74/

To set up a new JS project: under the File Menu choose -> New Project.

建立一个新的 JS 项目:在文件菜单下选择 -> 新建项目。

Step 1:Select HTML5 in categories and HTML5 Application in Projects Step 1: select HTML5 in categories and HTML5 Application in Projects

第 1 步:在类别中选择 HTML5,在项目中选择 HTML5 应用程序 第一步:在分类中选择HTML5,在项目中选择HTML5应用

Step 2:Name your application. Step 2: name your application

第 2 步:命名您的应用程序。 第 2 步:命名您的应用程序

Step 3:Choose a site template. Step 3: choose a site template

第 3 步:选择站点模板。 第 3 步:选择站点模板

Step 4:Search for available libraries, click on the Version number to download previous versions. Step 4: Search for available JS libraries in 'Available'

第四步:搜索可用的库,点击版本号下载以前的版本。 第 4 步:在“可用”中搜索可用的 JS 库

Finish and you are done.

完成,你就完成了。

NetBeans 7.3(scheduled for release in February 2013) introduces a new project type optimized for developing client web applications. This new project type can be found in New Project wizard in "HTML/JavaScript" category. HTML project supports is enabled by default for PHP and Java bundles of NetBeans, for other ones it need to be downloaded as a plugin.

NetBeans 7.3(计划于 2013 年 2 月发布)引入了一种为开发客户端 Web 应用程序而优化的新项目类型。这种新项目类型可以在“HTML/JavaScript”类别的“新建项目”向导中找到。HTML 项目支持默认为 NetBeans 的 PHP 和 Java 包启用,对于其他包,它需要作为插件下载。

see: http://wiki.netbeans.org/NetBeans_73_NewAndNoteworthy#Project_Creation

请参阅:http: //wiki.netbeans.org/NetBeans_73_NewAndNoteworthy#Project_Creation



Original answer:

原答案:

File> New Project> PHP > PHP Web Application.. Sounds like crap, but works fine. Because NetBeans doesn't have Javascript or HTML projects yet (in 7.0.1).

File> New Project> PHP > PHP Web Application.. 听起来像废话,但工作正常。因为 NetBeans 还没有 Javascript 或 HTML 项目(在 7.0.1 中)。

回答by élektra

[Note: this is for Netbeans 7.3+]

[注意:这适用于 Netbeans 7.3+]

In NetBeans, a PHP project is a pretty general web application that can contain JavaScript, HTML, PHP, CSS, XML, and all the different web & server technologies (except Java) the Netbeans supports. So you can use a PHP aapplication as a general web project. This option is better than an HTML5 project because it includes server-side processing in the form of PHP files. Also, if you are developing in JavaScript, you will probably be using Ajax at some point, and PHP is a good language for the server side of Ajax, as well as server-side processing in general.

在 NetBeans 中,PHP 项目是一个非常通用的 Web 应用程序,它可以包含 JavaScript、HTML、PHP、CSS、XML 以及 Netbeans 支持的所有不同的 Web 和服务器技术(Java 除外)。因此,您可以将 PHP 应用程序用作通用 Web 项目。此选项比 HTML5 项目更好,因为它包含 PHP 文件形式的服务器端处理。此外,如果您使用 JavaScript 进行开发,那么您可能会在某个时候使用 Ajax,而 PHP 是 Ajax 服务器端以及一般的服务器端处理的好语言。

Instructions

指示

Create a PHP Project.

创建一个 PHP 项目。

  1. Go to the Filemenu.
  2. Click New Project.
  3. Select PHPin Categories.
  4. Select PHP Application.
  5. Click Next
  6. Fill out the details.(Name, location, server, etc. This part is pretty self explanatory.) (Note: if you need help, click the Help button in the lower right corner)
  1. 转到File菜单。
  2. 单击New Project
  3. PHP在类别中选择。
  4. 选择PHP Application
  5. 点击 Next
  6. 填写详细信息。(名称,位置,服务器等。这部分是不言自明的。)(注意:如果您需要帮助,请单击右下角的“帮助”按钮)

If you do not have the PHPOption in the New Project Dialog, then you did not install the PHP NetBeans plugin.

如果PHP在“新建项目”对话框中没有 Option,则说明您没有安装 PHP NetBeans 插件。

Installing the PHP Plugin:

安装 PHP 插件:

  1. Go to the Toolsmenu.
  2. Click on the Pluginsoption. (It is second from the bottom)
  3. Click on the Available PluginsTab.
  4. Search PHP.
  5. Check the checkbox next to the PHPPlugin..
  6. Click Install. (Lower-left corner)
  7. Click Nexton the dialog that comes up.
  8. Click the I acceptcheckbox.
  9. Click the Installbutton.
  10. If a little window pops up in the lower right corner that says restart IDE, Exit Netbeans, and then Open it again. It may take longer than usual because it is installing the new Features.
  1. 转到Tools菜单。
  2. 单击该Plugins选项。(从下数第二个)
  3. 单击Available Plugins选项卡。
  4. 搜索PHP
  5. 选中PHP插件旁边的复选框..
  6. 单击Install。(左下角)
  7. 单击Next出现的对话框。
  8. 单击I accept复选框。
  9. 单击Install按钮。
  10. 如果右下角弹出一个小窗口,上面写着restart IDE退出 Netbeans,然后再次打开它。由于正在安装新功能,因此可能需要比平时更长的时间。

To make JavaScript Files:

制作 JavaScript 文件:

  1. Go to the Filemenu.
  2. Click New File.
  3. [Select the relevant category]

    A. (Netbeans 8.x) click HTML5in Category.
    B. (Netbeans 7.x) click Otherin Category.

  4. Select JavaScript File.
  5. Fill out the details. (Name, location,etc.)
  1. 转到File菜单。
  2. 单击New File
  3. [选择相关类别]

    A.(Netbeans的8.x的)点击HTML5Category
    B.(Netbeans的7.x版)点击OtherCategory

  4. 选择JavaScript File
  5. 填写详细信息。(姓名、地点等)

回答by James Jithin

NetBeans do support development of JavaScript. But, the Javascript files should have a web project container. Hence, first create a Web Application project by going to File> New Project> Java Web> Web Application. Continue and create a project. Once the project is created, expand the project to view Web Pagesfolder. Right click on the folder and select New > Other. Choose Otherin Categoriesand then select JavaScript File. Start developing.

NetBeans 确实支持 JavaScript 的开发。但是,Javascript 文件应该有一个 Web 项目容器。因此,首先通过转到创建一个 Web 应用程序项目File> New Project> Java Web> Web Application。继续并创建一个项目。创建项目后,展开项目以查看Web Pages文件夹。右键单击文件夹并选择New > Other。选择OtherCategories,然后选择JavaScript File。开始开发。

回答by Raymond Wachaga

To force NetBeans to check JavaScript within PHP files, follow these instructions.

要强制 NetBeans 检查 PHP 文件中的 JavaScript,请按照以下说明进行操作。

Go to Tools > Options > Miscellaneous > Files. From drop down menu File Extension select php5. From drop down menu Associated File Type (MIME) select text/javascript

转至工具 > 选项 > 其他 > 文件。从下拉菜单文件扩展名中选择 php5。从下拉菜单关联文件类型 (MIME) 中选择 text/javascript

回答by TheBigChung

do this:

做这个:

  • Choose File --> New Project to open the New Project wizard.
  • Select HTML5/JS Application in the HTML/JavaScript category. and then continue with the ush.
  • 选择文件 --> 新建项目以打开新建项目向导。
  • 在 HTML/JavaScript 类别中选择 HTML5/JS 应用程序。然后继续 ush。

回答by Martin Zeitler

the NetBeansPHPversion should have those project templates.

NetBeans的PHP版本应该有那些项目模板。

... while one can still add further language support via plugins.

...虽然仍然可以通过插件添加进一步的语言支持。

teamed up with Chrome/Chromium (NetBeans Connector) it's optimal for web development.

与 Chrome/Chromium(NetBeans 连接器)合作,它是 Web 开发的最佳选择。

回答by Fini

Check out this brand new plugin (I have not yet tested it)

看看这个全新的插件(我还没有测试过)

NBWebProjectType - Generic projecttype for websites in NetBeans

NBWebProjectType - NetBeans 中网站的通用项目类型

回答by Netorica

click new file > [Categories] others > Javascript file

单击新文件 > [类别] 其他 > Javascript 文件