c# - Function only excuting with debugger after creation -


i have visual studio 2013 project, asp mvc 4 more specific.

i working on dynamics multiple selects, should filled selected options when chose value on parent select.

it works when apply debugger line top of function.

here fsfiddle https://jsfiddle.net/qtuxtrml/

here function issue

function setselectedvalues(elem)     {         debugger;         var combo = "#serial" + string(elem);         $(combo + ' option').each(function () {             var valor = $(this).attr('value');             var existe = jquery.inarray(valor, serialsy);             console.log(existe);             //console.log(serialsx);             if (string(existe) == '-1') {                 console.log('existe');                 $(combo + ' option[value="' + valor + '"]').prop("selected", true);             }         });     } 

and here behavior on video ;) https://youtu.be/hhv2jmalarg

any appreciated, thanks

ok, issue had call asyc: false instead of async: false, call asynchronous, because spelling mistake, , disappointed of jquery not showing me error that