source: other-projects/FileTransfer-WebSocketPair/Themes/themebuilder/bin/phantomjs-1.9.2-windows/examples/pagecallback.js@ 31525

Last change on this file since 31525 was 31525, checked in by ak19, 7 years ago

Nathan provided more stuff: Themes folder contains Sencha's Themebuilder which generates GXT Themes. It includes the .theme and generated .jar files for the project theme.

File size: 609 bytes
Line 
1var p = require("webpage").create();
2
3p.onConsoleMessage = function(msg) { console.log(msg); };
4
5// Calls to "callPhantom" within the page 'p' arrive here
6p.onCallback = function(msg) {
7 console.log("Received by the 'phantom' main context: "+msg);
8 return "Hello there, I'm coming to you from the 'phantom' context instead";
9};
10
11p.evaluate(function() {
12 // Return-value of the "onCallback" handler arrive here
13 var callbackResponse = window.callPhantom("Hello, I'm coming to you from the 'page' context");
14 console.log("Received by the 'page' context: "+callbackResponse);
15});
16
17phantom.exit();
Note: See TracBrowser for help on using the repository browser.