lindm Posted November 13, 2009 Share Posted November 13, 2009 The following script shows the alert box immediately...I want the alert to show when the iteration is done...possible? $("#trans").click(function() { $(".eng").each(function() { $(this).val("test"); }); alert("Ready"); }); Link to comment https://forums.phpfreaks.com/topic/181434-jquery-alert-after-iteration-complete/ Share on other sites More sharing options...
trq Posted November 13, 2009 Share Posted November 13, 2009 I want the alert to show when the iteration is done... It does. It just happens very quickly. You could test it if you like.... $("#trans").click(function() { var i; $(".eng").each(function() { $(this).val("test"); i++; }); alert("Iterator at "+i); }); Link to comment https://forums.phpfreaks.com/topic/181434-jquery-alert-after-iteration-complete/#findComment-957093 Share on other sites More sharing options...
lindm Posted November 13, 2009 Author Share Posted November 13, 2009 The complete function translates each field via google and the text is does not translate until I click ok on the alert box. $("#trans").click(function() { $(".eng").each(function() { string = "#"+$(this).attr("id"); string2 = string.replace("ENG",""); $(this).val($(string2).val()); $(this).val($(this).translate("sv","en")); }); alert("Done."); }); Link to comment https://forums.phpfreaks.com/topic/181434-jquery-alert-after-iteration-complete/#findComment-957115 Share on other sites More sharing options...
trq Posted November 13, 2009 Share Posted November 13, 2009 So remove the alert. Link to comment https://forums.phpfreaks.com/topic/181434-jquery-alert-after-iteration-complete/#findComment-957126 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.