How to make a synchronous call using play framework JSRoute
jsRoutes.controllers.Controller_name.function_name().ajax({ //ajax handlers here });
Want this call to execute and fetch data before proceeding to rest of the program.
Its a really bad idea (tm) but if you really want to do it you should be able to do it by providing the async property in the parameter to ajax:
var result = null;
jsRoutes.controllers.Controller_name.function_name().ajax({
async: false,
success: function(data) {
result = data;
}
});
// won't continue here until response is processed