You might want to use MediaWiki's <code>jquery.json</code> module for improved compatibility.