javascript - array of deferred ajax requests never entering in when.apply().done() -


I have the following code to handle many AJAX requests, and wait for them to process and their results Insert when. Application :

  var requestsArere = []; Var url = "http: // ..."; Console.log ("url:" + url); Var req1 = $ Ajax ({type: "gET", url: url, datatype: "xml"}); Req1.done (function (resp1) {$ (resp1). Search ('interest'). (Function () {var interest_id = $ (this). Find ('id'). Text (); var interest_name = $ (This) .find ('name'). Text (); var request = $ .ajax ({type: "gET", url: "http://en.wikipedia.org/w/api.php?action= Pars & amp; format = json & amp; page = "+ interest_name +" and redirects and promotion = text ", datatype:" jsonp "}) Requested password (;)); $ when. , Request more) .done (function () {console.log (arguments); //; recomputations in the same order from `arguments` var responses = arguments;})}} ;  

Why does not it ever enter $. When.apply , and do not print any console.log (Argument);

  $ .ajax ({type: " GET ", URL:" http: /en.wikipedia.org/w/api.php?action=parse&format=json&page= "+ // ^^^ interest_name +" and redirect & amp; Prop = text ", data type:" jsonp "});  

You entered the misspelled. url , not url

No url has been given, it will receive the current page, which is not in the Jsonp format, which will lead to a Parser, which will done does not fill the callback, but which you have not passed.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -