06-04-2022, 02:10 PM
(05-27-2022, 03:00 AM)Alexandre Machado Wrote: Sorry for the late reply, somehow I missed this.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.
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.
Very hard to find
Andrea