0
添加變量作爲輸入我想使用這個幻影代碼,但使用的是Node.js,但我不覺得system.args [1]在node.js的等效的Node.js:如何在URL
var phantom = require('phantom');
// var page = new WebPage();
// var system = require('system');
// var sBlob = system.args[1];
var sUrl = 'file:///C:/Users/editor.html?Blob='+sBlob;
phantom.create(function(ph) {
ph.createPage(function(page) {
page.open(sUrl, function(status) {
console.log("opened diagram? ", status);
page.evaluate(function() {
return document.getElementById("GraphImage").src;
}, function(result) {
console.log(result)
ph.exit();
});
});
});
}, {
dnodeOpts : {
weak : false
}
});
【如何命令行參數傳遞給Node.js的?(HTTP的可能重複:// stackoverflow.com/questions/4351521/how-to-pass-command-line-argu ments-to-node-js) – SWeko
@sweko我希望能夠傳遞sBlob,它是url的輸入 – ameni