【发布时间】:2022-11-24 20:32:48
【问题描述】:
我想制作一个按钮,在按下时发出提醒(消息),但该按钮不起作用。 按钮的代码在母版页中
(我把剩下的两页写在了cmets中,因为当我在帖子中写的时候出现了错误)
这是我的 master.blade.php;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>E-Comm Project</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<body>
</body>
<script>
$(document).ready(function())
{
$("button").click(function())
{
alert("button works correctly")
}
}
</script>
</html>
【问题讨论】:
-
那是 web.php 页面 <?php use Illuminate\Support\Facades\Route; Route::get('/', function () { return view('login'); }); .thats 登录页面 @extends('master') @section('content') @endsection <h1>Hello,world</h1> <button class="btn btn-primary">点击</button>
-
您需要了解更多有关Laravel Blade Template和Example of how to use的信息
标签: php html laravel laravel-8