Sha256: 0c5dec4e475f3e2a1f850b0577ff4ea9aed174a29bef97886bc5b088306a6107

Contents?: true

Size: 543 Bytes

Versions: 17

Compression:

Stored size: 543 Bytes

Contents

p = require("webpage").create()

p.onConsoleMessage = (msg) ->
  console.log msg

# Calls to "callPhantom" within the page 'p' arrive here
p.onCallback = (msg) ->
  console.log "Received by the 'phantom' main context: " + msg
  "Hello there, I'm coming to you from the 'phantom' context instead"

p.evaluate ->
  # Return-value of the "onCallback" handler arrive here
  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

Version Path
hooch-0.4.2 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee
hooch-0.4.1 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee
hooch-0.4.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee
hooch-0.3.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee
hooch-0.2.1 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee
hooch-0.2.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee
hooch-0.1.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee
hooch-0.0.8 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee
hooch-0.0.7 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee
hooch-0.0.6 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee
entangled-0.0.16 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee
entangled-0.0.15 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee
entangled-0.0.14 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee
entangled-0.0.13 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee
entangled-0.0.12 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee
entangled-0.0.11 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee
entangled-0.0.10 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/pagecallback.coffee