Jump to content

JS + command line


Recommended Posts

Hello, I am working on a project in which I need to out put text to the command line, as well as prompt for input from the command line. The application is to use JS and I'm looking for some reference materials on pulling this off. Any info is appreciated. Thanks!

Link to post
Share on other sites
Are you using Node.js? if you're trying to do this from a browser that's not going to happen.
No it's not being done through the browser, it's more of a test application than a functional one. From the command line in Windows I'm using the cscript //nologo file.js command to run the application. I'm going to output the interactions within the file.js to a xml doc as a log eventually.
Link to post
Share on other sites

Javascript running in a browser can't interact directly with the operating system. If you're just doing this for yourself then you can use ActiveX components, which are only supported by IE, and you'll probably need to set special permissions for your page to allow it to happen. http://www.itjungle.com/mpo/mpo052302-story01.html

Link to post
Share on other sites

OK, so how do output back to that command line? For instance this block of code will output to an html doc, and then to the browser, for a user to see....

var prompt = "Hello, this is x calling.";			  //output prompt function S_Hello(prompt){  return prompt;											  } document.write(S_Hello);

However, I need code to output right to that command line/shell for the user to see the output and then enter in more further on in the program.

Edited by metadata
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...