Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant