JSONPLint.com is Here!

Hopefully you have used both JSLint.com or JSONLint.com to validate and maybe just for some formatting of your code. If you haven’t, shame!

I work at Sencha providing crazy fast support on the forums and a lot of times I need to look at the response people are using. Either it’s JSON, JSONP or on a bad day it’s XML. I use JSONLint.com to make the JSON or JSONP readable and also tell me if it’s even valid. JSONLint.com does a fantastic job for me but when I have JSONP I have to manually remove the callback function to only have the JSON or else JSONLint.com will yell at me.

So I decided to do something about it and registered JSONPLint.com just so I can make sure the actual JSON is valid and also see if the JSONP is actually valid. I found out Zach Carter actually does the pure JavaScript JSON validation behind JSONLint.com and has the code up on GitHub (here) which is fantastic and makes my life easier. All I have to do is remove the callback function and validate the actual JSON which is easy. So I modified Zach Carter’s example to do just that and did some coloring to fit my own needs for a first draft.

What’s next? First, need to clean it up. Got the first draft done but there is a better way to strip out the callback function. After that I would like to support url calling where you can pass params and headers so you can lint remote JSONP right from JSONPLint.com

Mitchell is the Senior Forum Manager at Sencha Inc.

Twitter LinkedIn 

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

2 thoughts on “JSONPLint.com is Here!

  1. Thanks for this nifty tool! I noticed one minor bug – it requires a semi-colon after a JSON-P callback function, which isn’t necessarily required for valid Javascript.

    This certainly beats getting errors off of JSONLint though.. :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>