Is there any updated documentation on JSONP with cross browser domain? Or any advice where I'm going wrong?
I found this example: http://datatables.net/beta/1.8/examples/server_side/jsonp.html and this example for remote domain: http://www.datatables.net/examples/server_side/jsonp.html. I'm a front-end developer that received a URL that outputs JSON from the server-side developer and I'm unsure where I'm going wrong and how to use columns appropriately.
Any help is greatly appreciated.
My code:
$('table.display').dataTable( {
"scrollY": "500px",
"scrollCollapse": true,
"paging": true,
"jQueryUI": true,
stateSave: true,
"dom": 'C<"clear">Rlfrtip',
"processing": true,
"serverSide": true,
$.ajax( {
"url": "http://jsonoutput", //the URL will only work on my computer, but the output is below
"dataType": "jsonp",
"data": {
"columns": [
{"data": 'leadNum'},
{"data": 'lastName'},
{"data": 'firstName'}
] },
"dataType": "jsonp",
"cache": false
} );
} );
The URL points to JSON is in this format:
[{"LeadNum":1,"LastName":"Smith and another long name","FirstName":"Bill and another long name","Address":"4321 Kirkwall St","City":"South Jordan","State":"California","Zip":"12345","Phone":"987-654-3210","Cell":"012-345-6789","Email":"anthonydfabrizio@somelongname.com","CreationDate":"2014-08-06 10:54:56","ProjectedCloseDate":"2014-10-15 00:00:00","SalesRep1":1,"SalesRep2":2,"Type":1,"Priority":5,"ContactType":123,"ContactID":123456,"PaymentMethod":3,"EstimatedTotal":10000,"WonLost":123,"Status":null,"Comments":"","Notes":"","Location":3,"InvoiceNum":17890,"Advertising":"Radio Ad Group Number5","Advertising2":"","StreetLine2":"43211 Kirkwall Drive","CallBackDate":"0000-00-00 00:00:00","Snik1":"","Snik2":"","Snik3":"","SubmitTime":"1970-01-01","StyleName":"","ColorName":"","SampleEmployeeNum":0}]