?
Solved

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

Posted on 2010-11-23
2
Medium Priority
?
393 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 1500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

765 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