Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 23 lines (23 sloc) 0.837 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Clarinet</title>
    <script type="text/javascript">var exports = {};</script>
    <script type="text/javascript" src="../clarinet.js"></script>
    <script type="text/javascript">
    var parser = exports.parser();
    parser.onvalue = function (v) {
      console.log("Value: " + v);
    };
    parser.onkey = function (key) {
      console.log("Key: " + key);
    };
    parser.write('{ "firstName": "John", "lastName" : "Smith", "age" : 25, "address" : { "streetAddress": "21 2nd Street", "city" : "New York", "state" : "NY", "postalCode" : "10021" }, "phoneNumber": [ { "type" : "home", "number": "212 555-1234" }, { "type" : "fax", "number": "646 555-4567" } ] }').close();
    </script>
</script>
</head>
<body>
  Look at the console.
</body>
</html>
Something went wrong with that request. Please try again.