Это мой первый раз, используя этот сайт, чтобы обратиться за помощью, но мне было интересно, почему мой код не работает. Я студент первого курса, и поэтому я очень волновался! Любая помощь будет очень признательна и заблаговременно. И я приношу свои извинения за форматирование (мне нелегко было исправить это в редакторе фрагментов на этом сайте).Программирование Назначение
<html>
<head>
<meta charset ="UTF-8"/>
</head>
<body>
<script>var firstPerson = prompt(""Enter the full name of the first person:")</script>
\t <script>var secondPerson = prompt(""Enter the full name of the second person:")</script>
\t <script>var thirdPerson = prompt(""Enter the full name of the third person:")</script>
\t <script>var fourthPerson = prompt(""Enter the full name of the fourth person:")</script>
\t <script>var fifthPerson = prompt(""Enter the full name of the fifth person:")</script>
\t <script>alert("\"\\nThe \\nFirst\\n Person is ".concat("'", firstPerson, "'", "\\n\"\n\'\\nThe \\nSecond\\n Person is ",
'"', secondPerson, '"', "\\n\'\n\"\\nThe \\nThird\\n Person is ", '"', thirdPerson, '"', "\\n\"\n\'\\nThe \\nFourth\\n Person is ",
\t "'", fourthPerson, "'", "\\n\'\n\"\\nThe \\nFifth\\n Person is \\", fifthPerson, "\\", "\\n\""))</script>
\t <script>document.write("First Person: ".concat(firstPerson))</script>
\t <script>document.write("First person (last name, first name): ".concat(firstPerson.substring(5,14), ", ", firstPerson.substring(0, 4)))</script>
\t <script>document.write("Second Person: ".concat(secondPerson))</script>
\t <script>document.write("Second person (last name, first name): ".concat(secondPerson.substring(6,10), ", ", secondPerson.substring(0, 5)))</script>
\t <script>document.write("Third Person: ".concat(thirdPerson))</script>
\t <script>document.write("Third person (last name, first name): ".concat(thirdPerson.substring(6,11), ", ", thirdPerson.substring(0, 5)))</script>
\t <script>document.write("Fourth Person: ".concat(fourthPerson))</script>
\t <script>document.write("Fourth person (last name, first name): ".concat(fourthPerson.substring(6,12), ", ", fourthPerson.substring(0, 5)))</script>
\t <script>document.write("Fifth Person: ".concat(fifthPerson))</script>
\t <script>document.write("Fifth person (last name, first name): ".concat(fifthPerson.substring(6,10), ", ", fifthPerson.substring(0, 5)))</script>
\t <script>document.write("All of the first names are: ".concat(firstPerson.substring(0,4), ", ", secondPerson.substring(0,5), ", ", thirdPerson.substring(0,5),
", ", fourthPerson.substring(0,5), ", ", fifthPerson.substring(0,5)))</script>
\t <script>document.write("All of the last names are: ".concat(firstPerson.substring(5,14), ", ", secondPerson.substring(6,10), ", ", thirdPerson.substring(6,11),
\t ", ", fourthPerson.substring(6,12), ", ", fifthPerson.substring(6,10)))</script>
</body>
</html>
Что имеется в теле? Все, что я вижу, это Script – makdu
Во-первых, вам не нужно помещать каждую строку кода в тег 'script', попробуйте включить' type = 'text/javascript'' в свой тег скрипта, свой тег * one * script. Я посмотрю, что я могу сделать с вашим кодом. –
Нажмите F12, нажмите консоль, очистите результаты и снова запустите свой фрагмент. Эти ошибки будут хорошим местом для начала. – Gary