Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / phantomjs / lib / phantom / examples / pagecallback.coffee
1 p = require("webpage").create()
2
3 p.onConsoleMessage = (msg) ->
4   console.log msg
5
6 # Calls to "callPhantom" within the page 'p' arrive here
7 p.onCallback = (msg) ->
8   console.log "Received by the 'phantom' main context: " + msg
9   "Hello there, I'm coming to you from the 'phantom' context instead"
10
11 p.evaluate ->
12   # Return-value of the "onCallback" handler arrive here
13   callbackResponse = window.callPhantom "Hello, I'm coming to you from the 'page' context"
14   console.log "Received by the 'page' context: " + callbackResponse
15
16 phantom.exit()