Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
?
395 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

Industry Leaders: 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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

618 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