Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Please, give an example of load and use jquery #58

Open
eugen35 opened this issue Sep 30, 2018 · 0 comments
Open

Please, give an example of load and use jquery #58

eugen35 opened this issue Sep 30, 2018 · 0 comments

Comments

@eugen35
Copy link

eugen35 commented Sep 30, 2018

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 eugen35 changed the title Please, give anexample of load and use jquery Please, give an example of load and use jquery Sep 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant