Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

synchronous ajax request #14

Closed
rileytg opened this issue Aug 3, 2015 · 3 comments
Closed

synchronous ajax request #14

rileytg opened this issue Aug 3, 2015 · 3 comments

Comments

@rileytg
Copy link

rileytg commented Aug 3, 2015

$.ajax({
      url: indexFileUrl,
      async: false,
      cache: false,
      success: function (data, status) {
          languages = data.languages;
      }
    });

why not async?

@prabintp
Copy link

prabintp commented Aug 3, 2015

showing warning in browser console since not async
"Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/."

@gregpettit
Copy link

Yup, spotted. I understand the logic of making the calls synchronous (you need your language before you try to use it or you're at risk of 'undefined' hell) but most of us could just call some sort of initialization method in the async callback if we want to delay using the language.

@adrianfish
Copy link
Contributor

@gregpettit Fixed, take a look at the docs for details on how do do async.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants