[SalesForce] Visualforce javascript remoting synchronous

I am using javascript remoting to get data from apex method.

My problem is javascript remoting is working Asynchronously.I want to work it as synchronously.

Please suggest me.

Best Answer

By definition, VF remoting (like AJAX) is asyncrhonous. As the official documentation states "The remote method call executes synchronously, but it doesn’t wait for the response to return. When the response returns, the callback function handles it asynchronously."

This link would help explain how to use the associated parameters when firing a remoting call -

Depending on what your exact use case is, you may want to handle the behavior appropriately in your callback function.

Related Topic