访问量: 10 次浏览
onLoadStarted() 回调在网页开始加载时被调用。
onLoadStarted() 语法如下所示 −
wpage.onLoadStarted = function() {}
var wpage = require('webpage').create();
wpage.onLoadStarted = function() {
console.log('File has started Loading');
}
wpage.open("http://localhost/tasks/file.html", function(status) {
console.log(status);
});
上述程序生成以下输出。
File has started Loading
Success