Phoeniyx
Phoeniyx

Reputation: 572

PhantomJS / CasperJS injecting script with parameters

I am familiar with the injectJs and includeJs calls, in relation to PhantomJS/CasperJS. But, how do I add external Javascript with the following form:

<script src="https://www.google.com/recaptcha/api.js" async defer></script>

Please note the two parameters "async" and "defer". Thanks.

Upvotes: 2

Views: 172

Answers (1)

Phoeniyx
Phoeniyx

Reputation: 572

I couldn't figure out how to insert valueless attributes as I defined in my original question with PhantomJS / CasperJS. But it turns out, Google reCAPTCHA JS SDK works as intended if I do insert the value "true" to the two attributes. So, I injected the two attributes as:

<script src="https://www.google.com/recaptcha/api.js" async="true" defer="true"></script>

and it worked fine, even though their document only has the valueless attributes.

Upvotes: 1

Related Questions