我正在通过laravel和jquery设置动态相关菜单,突然间我注意到jquery在该特定页面上不起作用。
我已经拿出大部分代码来解决此问题(使jquery正常工作)
大多数代码都以laravel模板的形式出现(我相信这些不是问题,因为其他页面工作正常)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Quotation Section</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" href="http://pk19.test/bower_components/bootstrap/dist/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="http://pk19.test/bower_components/font-awesome/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="http://pk19.test/bower_components/Ionicons/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="http://pk19.test/dist/css/AdminLTE.min.css">
<!-- AdminLTE Skins. We have chosen the skin-purple for this starter
page. However, you can choose any other skin. Make sure you
apply the skin class to the body tag so the changes take effect. (blue, black, purple, yellow, red, green are available)-->
<link rel="stylesheet" href="http://pk19.test/dist/css/skins/skin-purple.min.css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Google Font -->
<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script charset="utf8" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.js"></script>
<style>
textarea {
display:block;
margin-bottom:1em;
clear:both;
}
</style>
</head>
<body class="hold-transition skin-purple sidebar-mini">
<div class="wrapper">
<!-- MAIN HEADER-->
<header class="main-header">
<a href="http://pk19.test/employee" class="logo">
<!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"><b>PKL</b></span>
<!-- logo for regular state and mobile devices -->
<span class="logo-lg"><b>PRINTKINGLANKA</b></span>
</a>
<!-- Header Navbar -->
<nav class="navbar navbar-static-top" role="navigation">
<!-- Sidebar toggle button-->
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
<span class="sr-only">Toggle navigation</span>
</a>
<!-- Navbar Right Menu -->
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<!-- Control Sidebar Toggle Button -->
<li>
<a href="http://pk19.test/employee/logout" onclick="event.preventDefault(); document.getElementById('frm-logout').submit();">
<i class="glyphicon glyphicon-log-out"></i>
</a>
<form id="frm-logout" action="http://pk19.test/employee/logout" method="POST" style="display: none;">
<input type="hidden" name="_token" value="brRxBIvewdaNo62nfFTHfBUV1sDg7D1SZ0govJjf">
</form>
</li>
</ul>
</div>
</nav>
</nav>
</header>
<!-- MAIN HEADER END-->
<!-- SIDEBAR START-->
<aside class="main-sidebar">
<aside class="main-sidebar">
<section class="sidebar">
<ul class="sidebar-menu" data-widget="tree">
<li class="header">JOB</li>
<li><a href="http://pk19.test/employee/job/create"><i class="fa fa-link"></i> <span>Add Job</span></a></li>
<li><a href="http://pk19.test/employee/job"><i class="fa fa-link"></i> <span>Job Tracker</span></a></li>
<li class="header">QUOTATION</li>
<li><a href="http://pk19.test/employee/quotation/create"><i class="fa fa-link"></i> <span>Add Quotation</span></a></li>
<li><a href="http://pk19.test/employee/quotation"><i class="fa fa-link"></i> <span>Quotation List</span></a></li>
<li class="header">PO</li>
<li><a href="#"><i class="fa fa-link"></i> <span>Add PO</span></a></li>
<li class="header">BILL</li>
<li><a href="#"><i class="fa fa-link"></i> <span>Add Bill</span></a></li>
<li><a href="#"><i class="fa fa-link"></i> <span>Pay Bill</span></a></li>
<li><a href="#"><i class="fa fa-link"></i> <span>Add Voucher</span></a></li>
<li><a href="#"><i class="fa fa-link"></i> <span>Bill Item Report</span></a></li>
<li><a href="#"><i class="fa fa-link"></i> <span>Bill Report</span></a></li>
<li class="header">BANKING</li>
<li><a href="#"><i class="fa fa-link"></i> <span>List Deposit</span></a></li>
<li class="header">OTHER</li>
<li class="treeview">
<a href="#"><i class="fa fa-link"></i> <span>USER</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="http://pk19.test/employee/user/user/create">Add User</a></li>
<li><a href="http://pk19.test/employee/user/company/create">Add Company</a></li>
<li><a href="#">Edit Company</a></li>
<li><a href="http://pk19.test/employee/user/delivery/create">Add Delivery Address</a></li>
<li><a href="http://pk19.test/employee/user/delivery">List Delivery Addresses</a></li>
<li><a href="http://pk19.test/employee/user/user">List Users</a></li>
<li><a href="http://pk19.test/employee/user/company">List Companies</a></li>
</ul>
</li>
<li class="treeview">
<a href="#"><i class="fa fa-link"></i> <span>VENDOR</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="http://pk19.test/employee/vendor/vendor/create">Add Vendor</a></li>
<li><a href="http://pk19.test/employee/vendor/company/create">Add Company</a></li>
<li><a href="http://pk19.test/employee/vendor/vendor">List Vendors</a></li>
<li><a href="http://pk19.test/employee/vendor/company">List Companies</a></li>
</ul>
</li>
<li class="treeview">
<a href="#"><i class="fa fa-link"></i> <span>ITEM</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li><a href="#">Add Item</a></li>
<li><a href="#">Add Item Category</a></li>
<li><a href="#">List Items</a></li>
</ul>
</li>
<li><a href="#"><i class="fa fa-link"></i> <span>List Dispatches</span></a></li>
<li><a href="#"><i class="fa fa-link"></i> <span>List Invoices</span></a></li>
<li><a href="#"><i class="fa fa-link"></i> <span>List Payments</span></a></li>
</ul>
</section>
</aside>
</aside>
<!-- SIDEBAR END-->
<!-- PAGE CONTENT START-->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Quotation Section
<small><b><u>
</u></b></small>
</h1>
</section>
<!-- MAIN CONTENT -->
<section class="content container-fluid">
<div class="row">
<div class="col-md-12">
<div class="box box-primary">
<div class="box-header with-border">
<h2 class="box-title">Add Quotation</h2>
</div>
</div>
</div>
</div>
</section>
<!-- MAIN CONTENT END -->
</div>
<!-- PAGE CONTENT END-->
<!-- /.content-wrapper -->
<footer class="main-footer">
<div class="pull-right hidden-xs">
<b>Version</b> 1.0
</div>
<strong>Best Impression, Royal Service, Conducive Environment, Customer is King</strong>
</footer>
<!-- SCRIPT START -->
<!-- ./wrapper -->
<!-- REQUIRED JS SCRIPTS -->
<!-- jQuery 3 -->
<!-- Bootstrap 3.3.7 -->
<script src="http://pk19.test/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- AdminLTE App -->
<script src="http://pk19.test/dist/js/adminlte.min.js"></script>
<!-- Optionally, you can add Slimscroll and FastClick plugins.
Both of these plugins are recommended to enhance the
user experience. -->
<script>
</script><!-- SCRIPT END -->
</body>
<script>
$(document).ready(function(){
alert("Hello World!");
});
</script>
</html>
我需要显示此警报框
答案 0 :(得分:3)
将底部的脚本更改为:
$(document).ready(function(){
alert("Hello!");
});
您没有关闭该功能。