【发布时间】:2012-11-24 08:10:51
【问题描述】:
我觉得问这个问题很愚蠢。但是我对下面的变量范围aaa 有一个烦人的问题。最后不应该输出test吗?但事实并非如此。我在函数中使用 aaa 做错了什么?
var casper = require('casper').create();
var aaa = 'test';
casper.start('http://google.com/', function() {
this.echo("I'm in");
});
casper.run(function(aaa) {
this.echo(aaa);
this.exit();
});
【问题讨论】:
标签: javascript node.js scope phantomjs casperjs