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"); }); Quote Link to comment 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); }); Quote Link to comment 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."); }); Quote Link to comment Share on other sites More sharing options...
trq Posted November 13, 2009 Share Posted November 13, 2009 So remove the alert. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.