javascript - catch SyntaxError and run alternate function
- by ludicco
Hello there,
I'm trying to build something on javascript that I can have an input that can be everything
like string, xml, javascript and (non-javascript string without quotes) as follows:
//strings
eval("'hello I am a string'"); /* note the following proper quote marks */
//xml
eval(<p>Hello I am a XML doc</p>);
…