CasperJS:evaluate()返回null值

时间:2017-08-11 14:30:22

标签: javascript phantomjs casperjs

给出以下示例,为什么categoryId null

var scripts = this.evaluate(function() {
    var raScripts = "A lengthy script";

    return raScripts;
});

var categoryId = this.evaluate(function() {
    var text = 'more text';
    var lengthyScript = scripts + ' ' + text;

    return lengthyScript;
});

this.echo('Status: ' + categoryId);
// categoryId is null

0 个答案:

没有答案