Import 3rd party js from script tag
I am trying to integrate the Stripe pricing table. The instructs say to add this to my HTML
<script async src="https://js.stripe.com/v3/pricing-table.js"></script>
. What is the best way to do this in SolidJS?6 Replies
The solution I've come up with so far is this
but this solution doesn't feel right.
I was hoping for the
<script>
equivalent of Solid's support for the <title>
tag.
Because it needs to be included on every site, why don‘t include it in the index.html?
Sry, should* be included on every site
i don't think it's a bad solution!
Why do you want to add it via solid?
I assume this script is used for stripe’s fraud prevention as well. So I would keep it in the html to get it working asap
When using this, I would throw it in the App.tsx or something that is always there.
I think the primitive Script Loader is a good solution.
you can check the document from : https://primitives.solidjs.community/package/script-loader/
Solid Primitives
A library of high-quality primitives that extend SolidJS reactivity