gpt4 book ai didi

javascript - 在此行发现多个注释 : End tag (</script>) not closed properly, expected >

转载 作者:行者123 更新时间:2023-11-30 08:59:43 25 4
gpt4 key购买 nike

我在脚本标签中使用嵌入式 javascript 函数 disableReturnDate() 编写了以下 html 代码。但是在关闭标签上给出了一个错误

*错误*

Multiple annotations found at this line:
- End tag (</script>) not closed properly, expected >.
- Unknown tag (script function addReturnDate() { if (document.getElementById('RoundTrip').checked)
{ document.write("Select Return Date:"); document.write("<script>DateInput('returndate',true,'DD-MON-YYYY');");
document.write("<input type=\"button\" onClick=\"alert(this.form.returndate.value)\" value=\"Show date value
passed\">"); } } </script> ).
- End tag of element <script>

*代码*

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Enter Date-Time, Arrival and Departure Location</title>
<script type="text/javascript" src="calendarDateInput.js"></script>
<script type="text/javascript">
function disableReturnDate() {
this.form1.returndate.disabled=true;
}
</script>
</head>
<body onload="disableReturnDate()">
<form name="form1" method="post" action="retrievePossibleRoutes.jsp">
Select Travel Date:
<script>DateInput('traveldate',true,'DD-MON-YYYY');</script>
<input type="button" onClick="alert(this.form.traveldate.value)" value="Show date value passed">
<br>
Select Return Date:
<script>DateInput('returndate',true,'DD-MON-YYYY');</script>
<input type="button" onClick="alert(this.form.returndate.value)" value="Show date value passed">
<input type="radio" name="journeyType" id="OneWay" onClick="disableReturnDate()" checked>One Way<br>
<input type="radio" name="journeyType" id="RoundTrip" onClick="enableReturnDate()">Round Trip<br>
<br>
Select Departure Location:
<select name="comboDep">
<option></option>
<option></option>
</select>
<input type="submit"/>
<br>
Select Arrival Location:
<select name="comboArrv">
<option></option>
<option></option>
</select>
<input type="submit"/>
</form>
</body>
</html>

知道哪里出了问题。错误中显示的代码是以前写的,但我现在删除了它,它仍然显示在错误消息中。期待回复

附言calendarDateInput.js 的链接是 http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm

最佳答案

您可以使用 W3C 验证器验证 HTML:http://validator.w3.org/check

出现了两个重要的错误。放

<!doctype html>

在 HTML 的开头(您可以在 doctype 标签中指定更多信息,因此请多研究一下),并确保所有标签都具有 type 属性集:

<script type="text/javascript">

关于javascript - 在此行发现多个注释 : End tag (&lt;/script&gt;) not closed properly, expected >,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10271591/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com