Is there a way to run JavaScript code inside Aptana Studio 3 IDE?

前端 未结 5 2575
感情败类
感情败类 2021-02-20 10:53

I created a Test.js file and wrote two lines of JS code in it:

var a = 5;
console.log(\"The result is = \" + a);

The output should be:

相关标签:
5条回答
  • 2021-02-20 11:12

    What you can do is you can download node.js from node.js, download the package and follow the installation instructions on the screen.

    If using a Windows, the node.js package comes with its own interactive command prompt which you can open. To run a js file on windows, open the windows command prompt, type in node, then the name of your file e.g. test.js. Node.js should run your file.

    If using a Mac, the node.js package runs through the terminal application on the mac. To run a file, type in node, then the name of your file e.g. test.js, node.js should run the file.

    Aptana Studio 3 has the ability to open the terminal inside the IDE itself. Save your file in Aptana Studio and follow the instructions to run a file on the mac.

    By the way, keep your files labelled in lowercase letters, I tried using Uppercase for the first letter and it did not work.

    Hope that helps.

    0 讨论(0)
  • 2021-02-20 11:20

    It's not exactly what you asked, but it might point you in the right direction. There's a project called EclipseMonkey ... I'm not sure the status. Here's a working (?) example. Your mileage will vary. http://blogs.edgehill.ac.uk/webservices/2008/10/16/aptana-outline-auto-expansion-monkeyed/

    0 讨论(0)
  • 2021-02-20 11:27

    I'm afraid it is not possible.

    But What I did was to setup a simple workbench.html file, where in the header I put

    [...]
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script src="js/myJsFile.js"></script>
    

    and then modified the myJsFile.js and saved it.

    Another very intersting possibility is given by http://www.developer.nokia.com/Community/Wiki/Aptana_WRT_Plugin:_Displaying_log_messages_in_Output_console

    just check it

    0 讨论(0)
  • 2021-02-20 11:35

    I think that it would be best if you give Node.js a try. This way, you get to call node test.js on a console window and see the result.

    0 讨论(0)
  • 2021-02-20 11:37

    I'm pretty sure that console is meant for viewing the output of Aptana's Ruby-based commands (installed under the Commands menu). It might be possible to follow the instructions here: http://www.chromium.org/for-testers/enable-logging and then tail the resulting log file in a Terminal panel (not the same as a console window).

    0 讨论(0)
提交回复
热议问题