浏览器需要两次文件
我在ESP32上写了一个非常简单的网页:
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/index.css">
<script src="js/dayjs.min.js"></script>
<script src="js/index.js"></script>
</head>
<body>
<form action="/submit" method="post">
<label for="actual-datetime">Set datetime</label>
<input type="datetime-local" id="actual-datetime" name="actual-datetime" value="" step="1"><br>
<label for="rtc">RTC datetime</label>
<input type="datetime-local" id="rtc" name="rtc" value="" step="1">
<hr>
<label for="alarm1">Alarm clock 1</label>
<input type="time" id="alarm1" name="alarm1" value="">
<select name="action1" id="action1">
<option value="wakeup">Wakeup</option>
<option value="standby">Standby</option>
<option value="idle">Idle</option>
</select><br>
<label for="alarm2">Alarm clock 2</label>
<input type="time" id="alarm2" name="alarm2" value="">
<select name="action2" id="action2">
<option value="wakeup">Wakeup</option>
<option value="standby">Standby</option>
<option value="idle">Idle</option>
</select><br>
<label for="alarm3">Alarm clock 3</label>
<input type="time" id="alarm3" name="alarm3" value="">
<select name="action3" id="action3">
<option value="wakeup">Wakeup</option>
<option value="standby">Standby</option>
<option value="idle">Idle</option>
</select><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
当我从浏览器打开此页面时(Firefox 101),我注意到某些文件是两次请求的:
是否有理由? 如何防止这种行为?
I wrote a very simple web page on an ESP32:
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/index.css">
<script src="js/dayjs.min.js"></script>
<script src="js/index.js"></script>
</head>
<body>
<form action="/submit" method="post">
<label for="actual-datetime">Set datetime</label>
<input type="datetime-local" id="actual-datetime" name="actual-datetime" value="" step="1"><br>
<label for="rtc">RTC datetime</label>
<input type="datetime-local" id="rtc" name="rtc" value="" step="1">
<hr>
<label for="alarm1">Alarm clock 1</label>
<input type="time" id="alarm1" name="alarm1" value="">
<select name="action1" id="action1">
<option value="wakeup">Wakeup</option>
<option value="standby">Standby</option>
<option value="idle">Idle</option>
</select><br>
<label for="alarm2">Alarm clock 2</label>
<input type="time" id="alarm2" name="alarm2" value="">
<select name="action2" id="action2">
<option value="wakeup">Wakeup</option>
<option value="standby">Standby</option>
<option value="idle">Idle</option>
</select><br>
<label for="alarm3">Alarm clock 3</label>
<input type="time" id="alarm3" name="alarm3" value="">
<select name="action3" id="action3">
<option value="wakeup">Wakeup</option>
<option value="standby">Standby</option>
<option value="idle">Idle</option>
</select><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
When I open this page from my browser (Firefox 101) I notice that some files are requested twice:
Is there a reason for that?
How to prevent this behavior?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论