Is there a way to confirm that a string has valid Javascript syntax?
Either a client side or server side solution would be ok.
For a client side solution I'd like to confirm that, say :
var a = "function foo { var t='ok'; alert(t); }"
is valid, or for a server side solution that
String a = "function foo { var t='ok'; alert(t); }"
is valid.
Thanks
Either a client side or server side solution would be ok.
For a client side solution I'd like to confirm that, say :
var a = "function foo { var t='ok'; alert(t); }"
is valid, or for a server side solution that
String a = "function foo { var t='ok'; alert(t); }"
is valid.
Thanks
Comment