I have url and i want to execute this url from cronjobs. in my php file there is javascript code to export highchart.
this is my code:
<script>
$(function () {
var options = {
title: {
text: 'Daily Chart',
x: -20 //center
},
exporting: {
url: 'http://export.highcharts.com/'
},
xAxis: {
categories: [
'A','B',
]
},
yAxis: {
title: {
text: 'IDR'
},
},
tooltip: {
valueSuffix: '°C'
},
series: [{
showInLegend: false,
name: 'Daily',
data: [
1,2
]
}]
};
var obj = {},
exportUrl = options.exporting.url;
obj.options = JSON.stringify(options);
obj.type = 'image/png';
obj.async = true;
var link=$.ajax({
type: 'post',
url: exportUrl,
data: obj,
dataType: 'html',
context: document.body,
global: false,
async:false,
success: function (data) {
var result=exportUrl+data;
return result;
}
}).responseText;
$.ajax({
type: 'get',
url: 'http://webserver2/index.php/report/render?link='+link+'&id=1',
data: link,
success: function (data2) {
//alert(data2);
}
});
});
</script>
If i execute it in my browser i will get file highcart.png to my server. But if i execute in cronjobs i get nothing. Any body know how to execute it with cronjobs??