Rohit Bajaj
asked on
Making a javascript parser in javascript language
Hi,
I need to make a javascript code which will parse a javascript file and tell me whether this is a valid javascript program or not. Are there any tools or libraries available to do so ?
Also i guess eval() function can be used to do it. But it could be dangerous as i have read on some websites...
I am bascially planning to embed the javascript parser on my web application and so whatever code the users puts in there my parser will parse it and tell whether its a valid javascript file or not.
Please provide some tips... A parser may not be even required probably if i could use eval statement ... or something similar. It will do the job out of the box without writing anything.
Thanks
I need to make a javascript code which will parse a javascript file and tell me whether this is a valid javascript program or not. Are there any tools or libraries available to do so ?
Also i guess eval() function can be used to do it. But it could be dangerous as i have read on some websites...
I am bascially planning to embed the javascript parser on my web application and so whatever code the users puts in there my parser will parse it and tell whether its a valid javascript file or not.
Please provide some tips... A parser may not be even required probably if i could use eval statement ... or something similar. It will do the job out of the box without writing anything.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The reason is i dont have to include and separate library in my code if this approach succeeds thereby lowering the page load time.