how to run a shell script using javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BibhuAshish
    New Member
    • Oct 2007
    • 34

    how to run a shell script using javascript

    Hi,
    I have a button. I want to run a shell script when i click that button.
    My HTML code is given below:
    Code:
    <html>
    <head>
    </head>
    <body>
    <input type = "button" value = "run script" onclick = "some javascript func to run script()">
    </body>
    </html>
    Can anybody help me out for this problem?
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    This won't be possible with standard JavaScript on a normal web page. What are you trying to do?

    Comment

    • BibhuAshish
      New Member
      • Oct 2007
      • 34

      #3
      Originally posted by acoder
      This won't be possible with standard JavaScript on a normal web page. What are you trying to do?
      Thanks for ur reply.
      I have two buttons one is for start server and other for stop server.
      To start a server one shell script is there and for stop also.
      I want to do that when i click start button it should start my server for that i have to run that shell script.
      Using java api Runtime and Process i can run shell script but by clicking a button how to run shell script i do not know.
      Can you help me out?????

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        If it's a shell script on the server, then use Ajax to call the server-side script. That's if you want to avoid a page unload. If not, you could just submit the page. If you're not familiar with Ajax, check out some of the links in the Off-site Links sticky.

        Comment

        Working...