PhantomJS 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