PhantomJS - onLoadStarted()



当页面开始加载时会调用此回调。

语法

其语法如下 −

wpage.onLoadStarted = function() {}

示例

var wpage = require('webpage').create();
wpage.onLoadStarted = function() {
   console.log('File has started Loading');
} 
wpage.open("https://127.0.0.1/tasks/file.html", function(status) {
   console.log(status);
}); 

以上程序生成以下输出

File has started Loading
Success
phantomjs_webpage_module_events_callbacks.htm
广告