简体   繁体   English

在Aptana Studio 3中运行JavaScript

[英]Run JavaScript in Aptana Studio 3

I used Aptana Studio 3 for Python, and when I hit the "Run", the results are shown in the the console. 我使用适用于Python的Aptana Studio 3,当我点击“运行”时,结果显示在控制台中。 However, when I created js file and then hit "Run", it opens up my firefox browser and show the codes there, not even the results. 但是,当我创建js文件然后单击“运行”时,它将打开我的firefox浏览器并在其中显示代码,甚至不显示结果。 Why is that? 这是为什么?

It seems impossible according to this thread . 根据这个线程看来是不可能的。 However, you can use node.js. 但是,您可以使用node.js。 Simply call node myFile.js to run it (after installation). 只需调用node myFile.js即可运行它(安装后)。 Another solution is embedding scripts in an html file. 另一种解决方案是将脚本嵌入html文件。

Well, for node.js : Go on their site : http://nodejs.org , and download it. 好吧,对于node.js:访问其网站: http : //nodejs.org ,然后下载。 After that, reboot and in eclipse, select Run > External Tools... > External Configuration. 之后,重新启动并在Eclipse中,选择Run > External Tools... > External Configuration. Then put : 然后放:

Location : node

Working directory: ${container_loc}

Arguments: ${resource_loc}

在此处输入图片说明 See this thread : Custom command for Eclipse on current file . 请参阅以下线程: 当前文件上的Eclipse自定义命令 Also note that the command alert does not work since it is cli. 还要注意,命令alert由于它是cli,所以不起作用。

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

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