javascript - Internet Explorer lags on assigment of a function to "onfocusout" Event -
my html form performing action (adding new line form able come in phone-number) when user left current input field.
this code results in massive lag when executed ie:
$("#createorupdatecontactpersonphonenumber0").on('focusout', function() { addanotherrow(); }); function addanotherrow() { $("#phonenumbertable tr:last-child").before('<tr><td><select style="width: 100px;" id="createorupdatecontactpersonphonetype' + $("#phonenumbertable tr:not(:first-child):not(:last-child)").length + '"></select></td><td><select id="createorupdatecontactpersonphonecountry' + $("#phonenumbertable tr:not(:first-child):not(:last-child)").length + '"></select></td><td><input style="height: 21px;" type="text" id="createorupdatecontactpersonphonenumber' + $("#phonenumbertable tr:not(:first-child):not(:last-child)").length + '"/></td><td><input style="height: 21px; width: 100px;" type="text" id="createorupdatecontactpersonphoneextension' + $("#phonenumbertable tr:not(:first-child):not(:last-child)").length + '"/></td><td><select id="createorupdatecontactpersonphonepurpose' + $("#phonenumbertable tr:not(:first-child):not(:last-child)").length + '"></select></td><td><center><input type="radio" name="createorupdatecontactpersonphoneprimary" id="createorupdatecontactpersonphoneprimary' + $("#phonenumbertable tr:not(:first-child):not(:last-child)").length + '"/></center></td><td></td></tr>'); };
when adding code of function "addanotherrow()" straight .on('focusout') event there no lag.
any suggestions how prepare this?
regards, marcel
use onblur instead of onfocusout. note onblur not bubble.
javascript jquery internet-explorer
No comments:
Post a Comment