Solved

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

Posted on 2010-11-23
2
384 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
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now