sAjaxSource set to a static file on Amazon S3
sAjaxSource set to a static file on Amazon S3
Hello,
Hopefully this is a quick one. I am using a static json file for my data source:
[code]
$(window).load(function() {
$('#table-results').dataTable({
"sAjaxSource": "data.json",
});
});
[/code]
... and everything works great.
Now, ideally I'd like to load the json file from an Amazon S3 bucket, like so:
[code]
$(window).load(function() {
$('#table-results').dataTable({
"sAjaxSource": "https://s3.amazonaws.com/mybucketname/data.json",
});
});
[/code]
... but this is not working. From the reading I did on this forum, the issue probably relates to the XSS (cross-site scripting) safeguards. So here is my question: is my assessment of the issue correct and if yes what workarounds if any I can employ to get this setup to work?
Thanks in advance for your help!
Hopefully this is a quick one. I am using a static json file for my data source:
[code]
$(window).load(function() {
$('#table-results').dataTable({
"sAjaxSource": "data.json",
});
});
[/code]
... and everything works great.
Now, ideally I'd like to load the json file from an Amazon S3 bucket, like so:
[code]
$(window).load(function() {
$('#table-results').dataTable({
"sAjaxSource": "https://s3.amazonaws.com/mybucketname/data.json",
});
});
[/code]
... but this is not working. From the reading I did on this forum, the issue probably relates to the XSS (cross-site scripting) safeguards. So here is my question: is my assessment of the issue correct and if yes what workarounds if any I can employ to get this setup to work?
Thanks in advance for your help!
This discussion has been closed.
Replies
1. Use JSONP (might not be an option if the file has to be static)
2. Use Yahoo Pipes
3. Use a proxy script
4. Use Flash
5. More? Probably - Google them :-)
Allan
Thanks for pointing me in the right direction. I must have not googled the right terms. I only came across option 1 in your list, but ruled it out because I assumed it requires the json to be served up by a process, rather than from a file. My entire website is static content, and I need to keep it this way, so I am guessing options 3 and 4 are out as well. I'll research Yahoo Pipes a little bit more.
But in any case -- thank you so much for your reply!
Daniel
Allan