Good afternoon, comrades! A friend asked for help with a calculator on the site It needs to be adapted to IE which are earlier than version 9. It is mainly on jQuery, but apparently due to some functions from js, the old man of IE cannot count. Help me please!

    1 answer 1

    There is such a piece of code

    diametr = $("select#diametr :selected").val().replace(/,/,"."); kind = $("select#kind :selected").val().replace(/,/,"."); ... anisept = Math.round( (diametr*1) * (anisept*1)); 

    It seems there are two problems: all these variables need to be declared with var and for some reason in the raplace parameter there are slashes around the comma. Need something like

     var diametr = $("select#diametr :selected").val().replace(',',"."); var kind = $("select#kind :selected").val().replace(',',"."); ... var anisept = Math.round( (diametr*1) * (anisept*1)); 
    • Thanks, in IE8 it worked, in the rest IE6-7, writes undefined - chuikoff