Reputation: 10374
I'm trying to integrate Stripe payments to my Blazor application. Straight away as predicted I must have a <script>
tag on my page.
https://stripe.com/docs/billing/quickstart
My question is, how do I add this script tag to a Razor page in Blazor. I've used interop to define my own JS files and call their methods, but i need this script to just be added to the DOM.
This documentation only shows me how to connect to my own JavsScript files:
Upvotes: 8
Views: 9016
Reputation: 1
Continuing answer of Sajjad Arash At the bottom of the page add:
<script src="../Components/Pages/Component.razor.js"></script>
Upvotes: 0
Reputation: 349
you can use new feature of blazor wasm and Use JSExportAttribute and JSImportAttribute and Handle your js modules in .net also you can read documentation here
Edited 2023-10-10
in .NET 8 you can add external JS files in your razor components and pages with <script>
tag and compiler no longer given error to using that
Upvotes: 3