1
你好,我的問題是這樣的:
ReferenceError: Can't find variable: $
phantomjs://webpage.evaluate():7 in loadScript
phantomjs://webpage.evaluate():55
phantomjs://webpage.evaluate():153
phantomjs://webpage.evaluate():153
ERROR: the options variable was not available, contains the infile an syntax error? see{ xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, series: [{ data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6,
148.5, 216.4, 194.1, 95.6, 54.4] }] };
Converted img name : D:/graph_.png
爲什麼會出現這個錯誤? 「找不到變量:$」
在highcharts-convert.js中,我將配置值更改爲正確的文件路徑。
HIGHCHARTS: 'D:\highcharts.js',
HIGHCHARTS_MORE: 'D:\highcharts-more.js',
HIGHCHARTS_DATA: 'D:\data.js',
JQUERY: 'D:\jquery.1.9.1.min.js',
我用PHP開始這樣的:
$type="Chart";
# Set file location.
$targetfile = "D:/test.js";
$prog = "D:/phantomjs.exe";
$progHc = "D:/highcharts-convert.js";
$callback = "D:/callback.js";
$outfile = "D:/graph_.png";
$result_flag = shell_exec($prog . " " . $progHc . " -infile " . $targetfile . " -outfile " . $outfile . " -constr " . $type . " -callback " . $callback);
$是jquery的問題,所以可能這個模塊沒有正確加載。 –
這解決了嗎?如果願意的話,很想知道解決方案。 – Mattias
也有同樣的問題 – luiscvalmeida