so what im doing is im loading some data with a get resquest and i get this variable on httpRequest.responseText and im using datatables to have some fancy table but the problem is i can not load my js var on ajax : field ..
<script type="text/javascript">
var httpRequest = null;
function SendRequest () {
if (!httpRequest) {
httpRequest = CreateHTTPRequestObject (); // defined in ajax.js
}
if (httpRequest) {
// The requested file must be in the same domain that the page is served from.
var url = '/resources/ud_auto_executions';
httpRequest.open ("GET", url, true); // async
httpRequest.onreadystatechange = OnStateChange;
httpRequest.send (null);
}
}
function OnStateChange() {
if (httpRequest.readyState==4) {
if (IsRequestSuccessful (httpRequest)) { // defined in ajax.js
alert ("hello im coming");
}
else {
alert ("Operation failed.");
}
}
}
</script>
i have trouble on the ajax :
<script>
$(document).ready(function() {
$('#example').DataTable( {
"AutoWidth": true,
"ajax": httpRequest.responseText