01-15-2024, 12:53 AM
Is there any difference between ExecuteJS() and CallbackResponse.AddJavaScriptToExecute()?
ExecuteJS and CallbackResponse.AddJavaScriptToExecute
|
01-15-2024, 12:53 AM
Is there any difference between ExecuteJS() and CallbackResponse.AddJavaScriptToExecute()?
01-28-2024, 06:02 AM
ExecuteJS() calls AddJavaScriptToExecuteAsCDATA() internally *when* it is a callback response (async). If the code is being executed from a sync event, it will call AddToInitProc() which also executes the JS code, but when the page loads.
So, in general it is safe to replace CallbackResponse.AddJavaScriptToExecute() by ExecuteJS() (which is waaaay shorter) with the advantage that it will also work during a sync event.
01-29-2024, 12:34 AM
(01-28-2024, 06:02 AM)Alexandre Machado Wrote: ExecuteJS() calls AddJavaScriptToExecuteAsCDATA() internally *when* it is a callback response (async). If the code is being executed from a sync event, it will call AddToInitProc() which also executes the JS code, but when the page loads. Okay, thanks alex |
« Next Oldest | Next Newest »
|