Ajax JSONP vs Ajax JSON

Benchmark created by Binyamin on


Description

Ajax JSONP vs Ajax JSON

Preparation HTML

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

Test runner

Ready to run.

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

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.