Solved

Looking for C# Windows Form to parse and validate a JAVAScript command from a text field.

Posted on 2010-11-23
2
390 Views
Last Modified: 2012-05-10
I am looking for a suggestion on how to parse and validate JAVASCRIPT that was entered into a text field on a windows form.  Is there any build in classes that will do this or is this a 3rd party tool that can added to an application to do this?  Any suggestions?
0
Comment
Question by:Hojoformo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
iHadi earned 500 total points
ID: 34200687
Hi

You can try the method in the following link:

http://madskristensen.net/post/Verify-JavaScript-syntax-using-C.aspx:

public void JavascriptTest()

{

  string[] javascriptFiles = Directory.GetFiles(@"D:\Website", "*.js",
SearchOption.AllDirectories);

 

  using (JavaScriptCompiler compiler = new JavaScriptCompiler())

  {

    compiler.Compile(javascriptFiles);

    Assert.IsFalse(compiler.HasErrors, compiler.ErrorMessage);

  }

}
0
 

Author Closing Comment

by:Hojoformo
ID: 34206704
I need to rephrase this question but it was answered.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question