1

Studying the following ajax request, I was wondering:

  • What advantages can a non-async ajax call achieve?
  • What is the .responseMessage good for, what does it store?

     var myTemplate = $.ajax({
     type: "GET",
     url: "myurl.html",
     async: false,
     cache: false
    }).responseMessage;
    
Software Engineer
3,9861 gold badge28 silver badges35 bronze badges
asked Feb 16, 2014 at 13:27
1
  • 1. google.com/…, 2. well the response of the AJAX call supposedly ...? Commented Feb 16, 2014 at 14:02

1 Answer 1

2

Setting async to false means that the statement you are calling has to complete before the next statement in your function can be called. If you set async: true then that statement will begin it's execution and the next statement will be called regardless of whether the async statement has completed yet.

In your code the function will not continue execution until the ajax call is complete.

answered Feb 16, 2014 at 14:06
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.