PhantomJS - onLoadStarted()



當頁面開始載入時會呼叫此回撥。

語法

其語法如下 −

wpage.onLoadStarted = function() {}

示例

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

以上程式生成以下輸出

File has started Loading
Success
phantomjs_webpage_module_events_callbacks.htm
廣告
© . All rights reserved.