Ajax JSONP vs Ajax JSON

JavaScript performance comparison

Test case created by Binyamin

Info

Ajax JSONP vs Ajax JSON

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="content"></div>

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Ajax JSONP
$.ajax({
 type: 'GET',
 url: 'http://jsperf.com/api/jsonp',
 dataType: 'jsonp',
 success: function(data) {
  $('#content').html(data.content);
 }
});
pending…
Ajax JSON
$.ajax({
 type: 'GET',
 url: 'http://jsperf.com/api/json',
 dataType: 'json',
 success: function(data) {
  $('#content').html(data.content);
 }
});
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment