Sha256: 7c3a9da2545a39640e6402a2779a60f051e779d225479e7031d8d1f1f877c3f6
Contents?: true
Size: 609 Bytes
Versions: 17
Compression:
Stored size: 609 Bytes
Contents
var p = require("webpage").create(); p.onConsoleMessage = function(msg) { console.log(msg); }; // Calls to "callPhantom" within the page 'p' arrive here p.onCallback = function(msg) { console.log("Received by the 'phantom' main context: "+msg); return "Hello there, I'm coming to you from the 'phantom' context instead"; }; p.evaluate(function() { // Return-value of the "onCallback" handler arrive here var callbackResponse = window.callPhantom("Hello, I'm coming to you from the 'page' context"); console.log("Received by the 'page' context: "+callbackResponse); }); phantom.exit();
Version data entries
17 entries across 17 versions & 2 rubygems