CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Location
    Germany
    Posts
    451

    Javascript to html in command line

    I am looking for a command line tool what can be used to run javascript code in html and generate a html file without javascript.

    Looking into Google V8 and Mozzila SpiderMonkey, those are good for running the Javascript but they do not have the proper environment (document, etc.).

    Is there any tool what can be invoked in a way that I feed in the html containing for example:
    <html>
    <script type="text/javascript">document.write("test");</script>
    </html>

    returns:
    <html>
    test
    </html>

    ?
    Last edited by luftwaffe; March 7th, 2013 at 02:49 PM.

  2. #2
    Join Date
    Mar 2013
    Posts
    2

    Re: Javascript to html in command line

    trying to help

  3. #3
    Join Date
    May 2002
    Posts
    10,943

    Re: Javascript to html in command line

    You could create any type of script to parse out the <script> tags through regular expressions. Install PHP on the local machine and run scripts through the command line.

    http://stackoverflow.com/questions/7...m-html-content
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured