phridge icon indicating copy to clipboard operation
phridge copied to clipboard

Please, give an example of load and use jquery

Open eugen35 opened this issue 7 years ago • 0 comments

var phridge = require("phridge"); var path = require("path"); var jqueryPath = path.resolve(__dirname, "jquery-1.6.1.min.js");

phridge.spawn() .then(function (phantom) { return phantom.openPage("http://localhost:3000/"); }) .then(function (page) { page.injectJs(jqueryPath); return page.run(function () { return this.evaluate(function () { return $("button").innerText; }); }); })

gives an error: TypeError: page.injectJs is not a function

eugen35 avatar Sep 30 '18 06:09 eugen35