Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

429
Views
La función SDK del botón de PayPal no encuentra su secuencia de comandos cuando se llama en Blazor

Tengo una blazor app y estoy tratando de implementar el botón de compra de PayPal . Genera el botón pero no funciona. Al presionar e inspeccionar la consola dice que

Error no detectado: el documento está listo y el elemento #paypal-button-container no existe

El script para el botón de Paypal está en la carpeta wwwroot , en el archivo javascript . La función del script se llama en la página del blazor component Index.razor

 @page "/" @inject IJSRuntime JS @inject AuthenticationStateProvider AuthenticationStateProvider @using LoginComponent @using Client.Data <AuthorizeView> <Authorized> Hi, @context.User.Identity.Name <div id="paypal-button-container"></div> </Authorized> <NotAuthorized> <Login/> </NotAuthorized> </AuthorizeView> @code { double a = 9.99; protected override async Task OnInitializedAsync() { } protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { await JS.InvokeVoidAsync("LoadButtonPaypal", a); } } }

Inspeccionar error de elemento:

 Uncaught Error: Document is ready and element #paypal-button-container does not exist at js?client-id=test:2 at new n (js?client-id=test:2) at Ce (js?client-id=test:2) at js?client-id=test:2 at Function.n.try (js?client-id=test:2) at fn (js?client-id=test:2) at js?client-id=test:2 at Function.n.try (js?client-id=test:2) at Object.render (js?client-id=test:2) at js?client-id=test:2

¿Por qué no encuentra el #paypal-button-container? ¿O no es este el problema por qué no funciona?

Aquí está el script para el botón del sitio web de PayPal .

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!