PhantomJS onLoadStarted () 使用教程与示例


发布日期 : 2021-08-24 00:51:52 UTC

访问量: 10 次浏览

PhantomJS onLoadStarted()

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