我想開發一個簡單的前端用於顯示使用BootStrap的圖像。然而,在使用BootStrap之前,查看圖像的按鈕工作正常,但是在使用引導程序設置頁面樣式之後,它什麼都不做,任何人都可以告訴我我做錯了什麼?當我試圖在Chrome的開發者工具看,我得到2個例外:BootStrap提交按鈕不起作用
Uncaught Error: You must include the utils.js file before tether.js
at tether.js:4
(anonymous) @ tether.js:4
bootstrap.min.js:7 Uncaught ReferenceError: Tether is not defined
代碼:
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<script src="script/tether.min.js"></script>
<script src="script/tether.js"></script>
<script src="script/jquery.min.js"></script>
<link rel="stylesheet" href="css/bootstrap.min.css"></link>
<link rel="stylesheet" href="css/styles.css"></link>
<script src="script/bootstrap.min.js"></script>
</head>
<body>
<h1 class="mt-4" align='center'> Demo Website </h1><br>
<div class="container" style="width:300px; background-color:ghostwhite;">
<div class="form-group">
<form action='viewimages2.php' method="GET">
<button class="btn-block btn btn-info" align='center' type="submit" name="Submit"> View Images </button>
</form>
</div>
</body>
</html>
工作代碼,而無需引導:
<!DOCTYPE html>
<!--
-->
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<H1 align='center'>Demo Website/h1><br>
<button align='center' type="button" onclick="window.location='Register.php';" value="Register"> Register </Button>
<button align='center' type="button" onclick="window.location='Login.php';" value="Login"> Login </Button>
<form action='viewimages2.php' method="GET">
<button type='submit' name="Submit"> View Images </button>
</form>
</body>
</html>
什麼是不清楚「你必須包括utils.js文件tether.js之前」? – Quentin
由於在tether.js之前包含utils.js給出了相同的異常,但在通過Swellar嘗試解決方案後現在被清除,但按鈕仍然不起作用 – user3930213