How to run <script src= > tag from javascript

Posted by Gleeb on Stack Overflow See other posts from Stack Overflow or by Gleeb
Published on 2013-06-29T10:06:18Z Indexed on 2013/06/29 10:21 UTC
Read the original article Hit count: 186

Filed under:

I am having some difficulties implementing Paypal buttons with backbone.js

The problem is that the button is implemented in a script tag:

<script src="paypal-button.min.js?merchant=YOUR_MERCHANT_ID"
data-button="buynow"
data-name="My product"
data-amount="1.00"></script>

which i cant run from Handlebars.js because the </script> tag is closing the handlebars <script>

I cant use eval(), or i don't understand how i am supposed to do that with the .

So there you have it. i am kind of stuck. I am out of ideas on how to implement this button with backbone.js the last resort is to ask the server to produce html pages with the script in them and then load them to the page.

i am just refusing to believe that JavaScript has no way to take care of this.

Please help.

This question relates to another question i asked in this subject.

Is it possible to use JavaScript inside handlebars.js template

Thank you.

© Stack Overflow or respective owner

Related posts about JavaScript