JQuery DataTables population issue

JQuery DataTables population issue

lipwig79lipwig79 Posts: 6Questions: 0Answers: 0
edited March 2011 in General
Hi all,

I have encountered a strange problem with the following code

$(document).ready(function() {
$('#example').dataTable({
"bProcessing":true,
"sAjaxSource":'http://localhost/utcms/json_source2.txt'});
});
});
This code loads the data into the table if I run the page in safari no problem. My issue is that if I run the same page through django with a render_to_response all I get is the processing sign no data. upon debugging it simply says: Failed to load resource: Cancelled.

Its not an issue with not being able to find the source file, I've also discounted the possibility of an issue resulting from rendering the page and disrupting the fetch process. I must be missing something in datatable setup. its strange that it works on a static page but not on a django rendered page even though it sees the file otherwise it would generate a 404 for that file on debug.

Any suggestions would be welcome

Cheers

Chris

PS: I am new to JQuery and DataTables

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    I'd say very likely you are running into a cross site scripting issue. Are you loading it from a different server or port? Something like http://localhost:8080/... would be blocked by the browser if your main page is http://localhost/... or a different domain name altogether.

    Allan
  • lipwig79lipwig79 Posts: 6Questions: 0Answers: 0
    Yeah I'd say that probably explains it, The file is on localhost the page is on localhost port 8000. Cheers
This discussion has been closed.