当前位置:网站首页>How to realize page inclusion
How to realize page inclusion
2022-07-25 15:38:00 【Gorgio_ Liu】
In the project , Used to put exactly the same content in multiple pages , Extracted separately as a separate file ( Such as header.html、footer.html), Any page that needs this file , Just import this page . The page contains many options :
1、 utilize Web Server's SSI command : The client requests a page , The server returns multiple pages at a time — Need modification Web Server profile .
2、 Pages provided with server-side dynamic languages contain functions : Such as PHP
include(‘header.php’);
...echo’ The main body ’;
include(‘footer.php’);The client requests a page , The server returned multiple messages PHP A page after page combination 、
3、 Use on client AJAX technology : First load the main content of a page , After loading . To request header.html、footer.html Put it in an empty container
<div id=”header”></div>
<main>xxxxxxxx</main>
<div id=”footer”></div>
$.ready(function(){
$(‘#header’).load(‘header.html’);
$(‘#footer’).load(‘footer.html’);
})Tips :AngularJS in ng The module provides an instruction :ngInclude, Method has been implemented 3
<div ng-include=” ’tpl/header.html’ “></div>
边栏推荐
- 数据系统分区设计 - 分区再平衡(rebalancing)
- Hdu3873 shortest path with dependency (topological sorting)
- < stack simulation recursion >
- p4552-差分
- C#精挑整理知识要点12 异常处理(建议收藏)
- mouseover和mouseenter的区别
- 2021 Shanghai match-b-ranked DP
- LeetCode - 622 设计循环队列 (设计)
- HDU3873-有依赖的最短路(拓扑排序)
- 2016 CCPC network trial c-change root DP good question
猜你喜欢

ML - 语音 - 语音处理介绍

Pytorch学习笔记--Pytorch常用函数总结1

matlab--CVX优化工具包安装

GAMES101复习:三维变换

Use cpolar to build a business website (how to buy a domain name)

Pytorch学习笔记--常用函数总结3

Brain racking CPU context switching

Phased summary of the research and development of the "library management system -" borrowing and returning "module

Pytorch学习笔记--SEResNet50搭建

MySQL transactions and mvcc
随机推荐
CVPR 2022 | 网络中批处理归一化估计偏移的深入研究
2021江苏省赛A. Array-线段树,维护值域,欧拉降幂
IOS interview questions
Cf685b find the center of gravity of each subtree of a rooted tree
CF566A-贪心+字典树
Seata中jdbc下只有一个lib嘛?
Deadlock gossip
Flex 布局
matlab--CVX优化工具包安装
2021上海市赛-D-卡特兰数变种,dp
wait()和sleep()的区别理解
C#精挑整理知识要点11 委托和事件(建议收藏)
HDU3873-有依赖的最短路(拓扑排序)
Hdu3873 shortest path with dependency (topological sorting)
ML - natural language processing - Introduction to natural language processing
How to solve the login problem after the 30 day experience period of visual stuido2019
小波变换--dwt2 与wavedec2
ML - 语音 - 深度神经网络模型
Geogle Colab笔记1--运行Geogle云端硬盘上的.py文件
ML - Speech - advanced speech model