$(function(){
$('#head).load('modal.html');
});
<!DOCTYPE html>
<html lang="en-gb" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Contact</title>
<link rel="icon" href="assets/img/favicon.png" type="image/x-icon">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600" rel="stylesheet">
<link rel="stylesheet" href="assets/css/main.css" />
<script src="assets/js/uikit.js"></script>
<script src="assets/js/jquery.js"></script>
<script src="assets/js/main.js"></script>
<script src="src/js/tokenvalidate.js"></script>
<script src="src/js/custom.js"></script>
<link rel="stylesheet" href="src/css/viewstyle.css">
<script src="node_modules/mark.js/dist/jquery.mark.min.js"></script>
<script src="node_modules/mark.js/dist/mark.min.js" charset="UTF-8"></script>
<script src="assets/js/custom.js"></script>
<link rel="stylesheet" href="assets/css/viewstyle.css">
<!-- Back to top -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<!-- Theme CSS-->de jquery code url for collapse -->
<link href="assets/css/navbar.css" rel="stylesheet" media="all">
<script src="globalsearch/search_content.js"></script>
<link rel="stylesheet" href="globalsearch/search.css">
<script src="globalsearch/search.js"></script>
<!-- Responsivness and Load -->
<script src="src/js/custom.js"></script>
<link rel="stylesheet" href="src/css/viewstyle.css">
<link rel="stylesheet" href="src/css/footer.css">
<!-- Bootstrap CSS -->
<link href="modal/assets/css/bootstrap.min.css" rel="stylesheet" />
<link href="modal/assets/css/font-awesome.min.css" rel="stylesheet" />
<link href="modal/assets/css/open-iconic-bootstrap.min.css" rel="stylesheet" />
<link href="modal/assets/css/styles.css" rel="stylesheet" />
<!-- Bootstrap Modal Login Popup Form // -->
<script src="modal/assets/js/popper.min.js"></script>
<script src="modal/assets/js/bootstrap.min.js"></script>
<script src="modal/assets/js/plugins/jquery-validation/jquery.validate.min.js"></script>
<script src="modal/assets/js/app.js"></script>
</head>
我有一个head
标签,其中包含许多script
和link
及CDN。我可以将head标签保存在一个文件中并在所有页面中加载吗?
$('#head').load('common/head.html');
如何有效保持head
标签。项目无法与服务器端通信