I wanted to schedule sending of report(chart made by javascript) via email in a weekly basis. To have that, I need to convert first the chart(made by javascript) to image using php(AJAX) and upload to the server then send it.
I'm already using node.js in my server but ajax doesn't work there. Is there's any way to get the same goal I want?
ReferenceError: XMLHttpRequest is not defined I got this error in the terminal.
Is there any error in my code?
var CronJob = require('cron').CronJob; new CronJob('10 * * * * *', function() {
ajax_request=new XMLHttpRequest;
ajax_request.onreadystatechange=function(){
if(ajax_request.readyState==4&&ajax_request.status==200){
console.log('You will see this message every second');
}
};
ajax_request.open("GET","http://domain.com/test.php",true);
ajax_request.send();
}, null, true, 'Asia/Manila');