javascript - jQuery: $.get(url) breaks my sequential script execution -
My attention is to check a calculated image URI, if it exists ...
If I This image, shown as an overlay:
$ (First_upplies). (Function () {$ ('# any_DOM_id'). Attachment ('& lt; img id = "first_image" (* & lt; img id = "first_image" src = "' + fallback_url + '" src = "' + First_url + '"/>);}) failed (function () {$ (' # any_DOM_id '). / & Gt;');}); / *** Here something is going big and is calculated *** /. . . . . AdInd ('& lt; img id = "second_image" src = "' + second_url + '" / "gt;';)}} failed (function () ($ ('# any_DOM_id'). Attachment ('& lt; Img id = "second_image" src = "'+ fallback_url +'" / "gt; ');});); & amp; id =' (img id =" third_image "src =" '+ third_url + "" Attachment ('& lt; img id = "third_image" src = "' + fallback_url + '" / "gt;'); }); $ ('# Any_DOM_id'). Attachments ('& lt; img id = "fourth_image" src = "' + fourth_urle + '" / "gt;');
My sequential chronology has broken, so the images are not in the correct position on the layers. Do I want to use $. Go away, or $. Does it always kill Chronon?
Edit:
This is what I am doing:
The images should be in order such as:
& lt; style & gt; .image_wrapper {status: relative;} .image_wrapper img {status: complete; } & Lt; / Style & gt; & Lt; Div id = "image_wrapper" & gt; & Lt; Img id = "first_image" src = "first_url" /> & Lt; Img id = "second_image" src = "second_url" /> & Lt; Img id = "third_image" src = "third_url" /> & Lt; Img id = "fourth_image" src = "fourth_url" /> & Lt; / Div & gt;
using .readuce ()
a boss Like P>
[first_url, second_url, third_url, fourth_url] .reduce (function (promise, url) {return promise. Then (function () {return $ .get (url);} ). Then (function (url content) {$ ('# any_DOM_id'). ('& Lt; img id = "my_image" src = "' + url + '" / />');}). Then (empty , Function () {$ ('(Android);'); $ () ;;), $ ();), $ () ());
Comments
Post a Comment