Solution:
You can find a link to the code for json.stringify here –
If you add that to your code then the error should go away.
Alternatively, you could add a reference to this script to your code –
<script src="http://ajax.cdnjs.com/ajax/libs/json2/20110223/json2.js"></script>