3

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:

https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/call-javascript-from-dotnet?view=aspnetcore-6.0#javascript-isolation-in-javascript-modules

JsonStatham
  • 9,770
  • 27
  • 100
  • 181
  • Does this answer your question? [Blazor Server: load js scripts only on certain pages, not on all](https://stackoverflow.com/questions/58976579/blazor-server-load-js-scripts-only-on-certain-pages-not-on-all) – Dimitris Maragkos Oct 22 '22 at 18:44

1 Answers1

0

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

Sajjad Arash
  • 91
  • 2
  • 6