че не пашет то !
привет ,
почему msg + не пашет , если закрыт комменты все работает привет , почему мсг + не пашет , если закрыт комменты все работает <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title > perehod </title> <meta http-equiv="content-type" content ="text/html; charset=windows-1251"> </head> <body> <script type="text/javascript"> var str1,str2,sum1,sum2,msg; str1=window.prompt("Vychesleniya summy dvyh chisel \n Vvedite chsilo 1",""); if (str1==null) { document.write("Vy nazhali otmena"); } else { str2=window.prompt("Vycheslenia summy dvyh chusel \n Vvedite chislo 2",""); if (str2==null) { document.write("Vy nazhali otmena"); } else { sum1=str1+str2; msg = " Do preobrazovaniya tipov : Znachenie summy chisel"; msg += str1+ "i " +str2 + " ravno" ; msg += sum1; sum2 = parseInt(str1) + parseInt(str2); msg + = " posle preobrazovaniya tipov : < br>"; msg += "znachenie preobrazovaniya summy chisel " + str1 + " i" ; msg += str2 +'+' +str1 + " ravno =" + sum2 ; document.write(msg); } } </script> </body> </html> |
Цитата:
в консоль, я так понимаю, смотрел, но не понял почему + = не работает, так смотри что + ожидает в качестве операндов http://es5.javascript.ru/x11.html#x11.6.1 |
Часовой пояс GMT +3, время: 06:15. |