newbee using dattable

newbee using dattable

fachhochfachhoch Posts: 1Questions: 0Answers: 0
edited March 2013 in DataTables 1.9
I am newbee, trying to use tabale with ajasource. Its not working, please advide whats wrong
[code]







$(document).ready(function() {
$('#displayData').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "http://localhost:8080/springrest/rest/service/cities.json"
} );
} );











Name
Telephone Code
Population




Loading data from server







[/code]

this is the error in chrow console

[code]
XMLHttpRequest cannot load http://localhost:8080/springrest/rest/service/cities.json?sEcho=4&iColumns=…gCols=1&bSortable_0=true&bSortable_1=true&bSortable_2=true&_=1364326752076. Origin null is not allowed by Access-Control-Allow-Origin.
[/code]

please advice me how to fix this.

Replies

  • janrusselcalachanjanrusselcalachan Posts: 10Questions: 0Answers: 0
    Try adding this line to the HEADER in your called script
    header('Access-Control-Allow-Origin: *');
This discussion has been closed.