complete:
callback (or any other AJAX callback methods) that
make another AJAX call that goes to a route to render a view and have code below that call that
manipulates the DOM:
ev1 = functionThatMakesAJAXRequest()
$.when(ev1).then () ->
(if using coffeescript)ev1
is completed before the lines of code you want to run are ran$.ajax
url: 'routes/blah/blah',
method: 'GET'
data: {
user_name: username
}
beforeSend: () ->
engageSpinner(true)
error: (e, xhr, data, status) ->
// lines of code
success: (results) ->
event1 = updateView('route') // this function makes an AJAX request to a route that loads content
$.when(event1).then () ->
displayRequestMsg("success", "Quote successfully transferred!", something)
complete: () ->
engageSpinner(false)