code: function evaluate(page, func) {
      var args = [].slice.call(arguments, 2);
      var fn = "function() { return (" + func.toString() + ").apply(this, " + JSON.stringify(args) + ");}";
      return page.evaluate(fn);
  }
docs: /*
  This function wraps WebPage.evaluate, and offers the possibility to pass
  parameters into the webpage function. The PhantomJS issue is here:
  
  http://code.google.com/p/phantomjs/issues/detail?id=132
  
  This is from comment #43.