Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82040

Unable to load jsonp data

$
0
0
I'm new to both json/jsonp and datatables. I've been tasked with figuring it out and using it for cross-domain issues regarding moving/sharing data between legacy and new systems.

I'm unable to load jsonp data into the datatable. It gets hung up at the processing label. I've tried quite a few options, read forums, etc. for the last 24 hours and am unable to figure it out. I can see the response I am getting. I validated the response and it seems fine. I just don't know how to get the data to appear.

Many thanks in advance.

Here is my document.ready statement:
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": false,
"sAjaxSource": "http://localhost/completedProjects?programID=11&jsonp=callback",
"fnServerData": function( sUrl, aoData, fnCallback, oSettings ) {
oSettings.jqXHR = $.ajax( {
"url": sUrl,
"data": aoData,
"success": fnCallback,
"dataType": "jsonp",
"cache": false
} );
}
} );
} );


Here's the table:
<table cellpadding="0" cellspacing="0" border="1" width="100%" class="display" id="example">
<thead>
<tr>
<th>Contract #</th>
<th>Project ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>Site Company Name</th>
<th>Site Address</th>
<th>City </th>
<th>State</th>
<th>Zip</th>
<th>Total kW</th>
<th>Total kWh</th>
</tr>
</thead>
<tbody>
</tbody>
</table>

And here's the jsonp response:
callback([{"AccountNumber":"9526496","ProjectID":2,"SponsorName":"Names","CompanyName":"93335 Stage Store #697","Address":"1112 S Main Street Grove ","TotalkW":4.01698,"TotalkWh":17153.85,"IncentiveAmount":null,"ApprovedDate":null},{"AccountNumber":"95733-0-4","ProjectID":1,"SponsorName":"Marj Watts","CompanyName":"German Church","Address":"1438 S. Indianapolis Shreveport LA 74112","TotalkW":8.8176,"TotalkWh":17506.944,"IncentiveAmount":null,"ApprovedDate":null},{"AccountNumber":"465465464","ProjectID":4,"SponsorName":"test test","CompanyName":"test","Address":"test test OK 73106","TotalkW":37.05,"TotalkWh":145635,"IncentiveAmount":null,"ApprovedDate":null},{"AccountNumber":"123123132131311","ProjectID":7,"SponsorName":"test test","CompanyName":"test","Address":"test test OK 73214","TotalkW":23.4,"TotalkWh":91980,"IncentiveAmount":null,"ApprovedDate":null}]);

Right now, it's dummy data, etc. not pointed at a real project, as you can guess by looking.

Debug Code: utoqef

Viewing all articles
Browse latest Browse all 82040

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>