To use JavaScript remoting in a Visualforce page, add the request as a JavaScript function call.
[namespace.]controller.method(
[parameters…,]
callbackFunction,
[configuration]
);
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.