Remote server connection

Remote server connection

GnorroGnorro Posts: 2Questions: 0Answers: 0
edited September 2009 in General
Hi
I have an application on www.site1.com
Is it possible to use DataTables with a remote server?
I mean calling from www.site1.com a page on www.site2.com?

$(document).ready(function() {
$('#alternativi').dataTable( {
"bProcessing":true,
"iCookieDuration":-1,
"bLengthChange":false,
"bPaginate": false,
"bFilter":false,
"bInfo":false,
"aoColumns": [
{ "sWidth": "100%" }
],
"sAjaxSource": 'http://www.site2.com/index.jsp?id=2'
}
);
} );


thanks

Replies

  • allanallan Posts: 61,762Questions: 1Answers: 10,111 Site admin
    Hi Gnorro,

    I suspect that this will probably fall foul of Cross Site Scripting (XSS) protection in all modern browsers. Because jQuery does an eval() on the return code, site2.com could inject harmful code into site1.com. There are ways around this, but they normally involve jumping through quite a few hoops. I'd suggest having a look at Google for XSS information.

    Regards,
    Allan
This discussion has been closed.