Defer load table from external url to reduce bandwidth

Defer load table from external url to reduce bandwidth

kittypolkittypol Posts: 1Questions: 1Answers: 0
edited August 2015 in Free community support

Hello;
I am using a jQuery plugin which is datatables, and i use it that way :
$('table').DataTable( { "ajax": "table.txt"});
This work fine because the file table.txt is located on the same directory as my javascript script in my hosting directory. But because the file table.txt size is important, this will consume me a lot of bandwidth so the idea i have is to host it in an other location for example a CDN or dropbox and then call it, for example like that:
$('table').DataTable( { "ajax": "http://dropbox/cdn/445587215/table.txt"});
But it doesn't work because I think jQuery cannot request files which are located outside of the current running domain name for security reasons, so the idea that come to my mind is to host both the javascript file that make the call to this table.txt file on the same folder on the CDN and then just include the javascript file using the tag like:

Do you think that this will work ? or can you advice me for a better approach ?
Thank you

This discussion has been closed.