当前位置:网站首页>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>
边栏推荐
- Qtime定义(手工废物利用简单好看)
- ML - Speech - advanced speech model
- mouseover和mouseenter的区别
- Pytorch学习笔记--常用函数总结2
- 2021 Shanghai match-b-ranked DP
- ML - natural language processing - Basics
- Cf888g clever dictionary tree + violent divide and conquer (XOR minimum spanning tree)
- ML - 语音 - 深度神经网络模型
- C # fine sorting knowledge points 10 generic (recommended Collection)
- LeetCode - 362 敲击计数器(设计)
猜你喜欢

matlab 优化工具 manopt 安装

GAMES101复习:变换

小波变换--dwt2 与wavedec2

GAMES101复习:三维变换

Pytorch学习笔记--SEResNet50搭建

LeetCode - 380 O(1) 时间插入、删除和获取随机元素 (设计 哈希表+数组)

Are you ready to break away from the "involution circle"?

MATLAB 如何生产随机复序列

LeetCode - 677 键值映射(设计)*

ML - natural language processing - Introduction to natural language processing
随机推荐
2019 Zhejiang race c-wrong arrangement, greedy
<栈模拟递归>
2019陕西省省赛K-变种Dijstra
How to solve the login problem after the 30 day experience period of visual stuido2019
Box avoiding mouse
Pat grade a 1152 Google recruitment (20 points)
See a lot of blinking pictures on apps, especially the member page
Distributed principle - what is a distributed system
C # fine sorting knowledge points 10 generic (recommended Collection)
LeetCode - 380 O(1) 时间插入、删除和获取随机元素 (设计 哈希表+数组)
In depth: micro and macro tasks
Application of C language array in Sanzi chess -- prototype of Queen n problem
Pat grade a 1153 decode registration card of PAT (25 points)
如何解决跨域问题
自定义注解校验API参数电话号
matlab--CVX优化工具包安装
GAMES101复习:线性代数
2021上海市赛-B-排序后dp
ML - 语音 - 语音处理介绍
谷歌博客:采用多重游戏决策Transformer训练通用智能体