简体   繁体   中英

Blazor Javascript Drop-In Script Not Working

I am working on integrating Chargebee into a Blazor app. The way the drop-in script for Chargebee works is I need to include a javascript script, which I am doing in my index.html file.

<script src="https://js.chargebee.com/v2/chargebee.js" data-cb-site="sitename-test"></script>

Then, in theory I should be able to just include a drop in link in one of my razor views like this.

<a href="javascript:void(0)" data-cb-type="checkout" data-cb-item-0="Product-Name" data-cb-item-0-quantity="1"> Subscribe </a>

But when I do this and run the site, click the link, nothing happens, no error, no drop-in popup. Is there something about Blazor that doesn't allow this action to work the way it would work with another framework? I have tested this with plain HTML files and it works fine.

Thanks in advance for any help.

You will need to call Chargebee.init(options); via JSInterop. See the documentation linked below for more details on the Chargebee JS API.

https://www.chargebee.com/checkout-portal-docs/api.html#chargebee-object

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM