Javascript examples for JSon:JSon Parse
Create an object with a function from string using Json parse()
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*www.jav a 2s . co m*/ var string = '{"func":"function (field) {var date = getDate(field);return date != -1;}","somethingElse": "Message","somethingElse2":"Message2"}'; var jsonObject = JSON.parse(string); console.log(jsonObject) } </script> </head> <body> </body> </html>