Running a javascript code outside of HTML file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mahmoodn
    New Member
    • May 2009
    • 77

    #1

    Running a javascript code outside of HTML file

    Hi,
    Is it possible to run a javascript outside of html file? I have a HTML page that submit user/pass via javascript code. Is it possible to run the javascript code from command line (linux)?
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    I don’t think it is possible without some kind of backend programme. JavaScript requires a host object, after all.

    Comment

    • mahmoodn
      New Member
      • May 2009
      • 77

      #3
      Any idea is welcomed. From should I start?

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4

        Comment

        • mahmoodn
          New Member
          • May 2009
          • 77

          #5
          I think all of the tools are GUI based. If I had a GUI, then there was no problem with the HTML file itself. So what I am looking is to run a command something like "java submit_auth" and submit_auth is a file which contains the javascript in the mentioned HTML file.

          Thanks,

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            So what I am looking is to run a command something like "java submit_auth"
            you are aware that this calls the JRE?

            However, you can try to run TraceMonkey or JavaScriptCore (or whatever host ist available) as stand-alone programme, but they might not do that by themselves.

            Comment

            • mahmoodn
              New Member
              • May 2009
              • 77

              #7
              I found it a very hard task!! I am not expert with such engines.... I should try to find an alternative first. Thanks

              Comment

              • rnd me
                Recognized Expert Contributor
                • Jun 2007
                • 427

                #8
                the simple way is to run it on a webserver that uses javascript, like .net or v8. then you can simply curl the webserver from the command line to get the input and output you need.

                Comment

                Working...