Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Paypal JS SDK API
#3
(05-27-2022, 03:00 AM)Alexandre Machado Wrote: Sorry for the late reply, somehow I missed this.

It's hard to know what's going on because it is kind of complicate to figure out from the code only...

Why are you using the hidden input to pass the data to the callback? Can't you pass the string directly to it?

What caught my eye is this piece of Javascript code:

                '    addHiddenInput("JSONRESPONSE",JSON.stringify(orderData, null, 2));    ' + sLineBreak +
                '    ajaxCall("JsonPayPalResponse","&TipoAbbonamento='+ TipoAbbonamento.ToString +'",false); //abbonamento personale ' + sLineBreak +
                '    });                  ' + sLineBreak +

addHiddenInput changes the DOM and ajaxCall() fires directly. As you mentioned above, seems that the ajaxCall needs the hidden input, is that so?

From my experience when adding nodes to the DOM sometimes code that runs immediately after that may or may not perceive the new node.

Is like the browser effectively updates the DOM tree only after calling the ajaxCall() line (it's like they were executed out of order).

I would start trying to call the ajaxCall() from inside a setTimeout call, something like:

setTimeout(function(){ajaxCall(bla bla bla)}, 10);

and see how it goes.
Hi Alexandre thank you for response. I think hidden input is more clean. If i pass from server a long string in isapi i coulb be generate an error on lenght of string that for security reason it could be short. Ok i can pass the call in a settimeout function. The problem is that happens something in particolar condition.
Very hard to find
Andrea
Reply


Messages In This Thread
Paypal JS SDK API - by Anto90 - 05-04-2022, 03:52 PM
RE: Paypal JS SDK API - by Alexandre Machado - 05-27-2022, 03:00 AM
RE: Paypal JS SDK API - by Anto90 - 06-04-2022, 02:10 PM
RE: Paypal JS SDK API - by Anto90 - 08-03-2022, 07:19 AM
RE: Paypal JS SDK API - by Alexandre Machado - 08-04-2022, 10:38 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)