lib/webpage.js
function (expressionFn, callbackFn) {
                    var self = this,
                        url = self.options.hostAndPort + '/page/functions/evaluate';

                    self.options.debug && console.log('calling url: %s', url);

                    request.post(url, {
                            form:{expressionFn:expressionFn.toString(), args:JSON.stringify(Array.prototype.slice.call(arguments, 2, arguments.length), null, 4)}
                        },
                        function (error, response, body) {
                            if (response && response.statusCode === 200) {
                                callbackFn && callbackFn.call(self, JSON.parse(body));
                            }
                            else {
                                console.error(body);
                                callbackFn && callbackFn.call(self, body);
                            }
                        });
                }
function (expressionFn, callbackFn) {
                    var self = this,
                        url = self.options.hostAndPort + '/page/functions/evaluate';

                    self.options.debug && console.log('calling url: %s', url);

                    request.post(url, {
                            form:{expressionFn:expressionFn.toString(), args:JSON.stringify(Array.prototype.slice.call(arguments, 2, arguments.length), null, 4)}
                        },
                        function (error, response, body) {
                            if (response && response.statusCode === 200) {
                                callbackFn && callbackFn.call(self, JSON.parse(body));
                            }
                            else {
                                console.error(body);
                                callbackFn && callbackFn.call(self, body);
                            }
                        });
                }
function ( expressionFn , callbackFn ) { var self = this , url = self . options . hostAndPort + '/page/functions/evaluate' ; self . options . debug && console . log ( 'calling url: %s' , url ) ; request . post ( url , { form : { expressionFn : expressionFn . toString ( ) , args : JSON . stringify ( Array . prototype . slice . call ( arguments , 2 , arguments . length ) , null , 4 ) } } , function ( error , response , body ) { if ( response && response . statusCode === 200 ) { callbackFn && callbackFn . call ( self , JSON . parse ( body ) ) ; } else { console . error ( body ) ; callbackFn && callbackFn . call ( self , body ) ; } } ) ; }
Evaluates the given function in the context of the web page. The execution is sandboxed, the web page has no access to the phantom object and it can't probe its own setting.
Evaluates the given function in the context of the web page . The execution is sandboxed the web page has no access to the phantom object and it can t probe its own setting .