PhantomJS - onLoadStarted()



This callback is called when the page starts loading.

Syntax

Its syntax is as follows −

wpage.onLoadStarted = function() {}

Example

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);
}); 

The above program generates the following output.

File has started Loading
Success
phantomjs_webpage_module_events_callbacks.htm
Advertisements