javascript - Static page html header and tail public files?
给我你的怀抱2017-07-05 10:44:43
0
4
1299
Multiple pages have the same header and footer. If I want to quote the same header and footer, how can I cite it? How to use jQuery to load an html page into the p I specified, considering compatibility
If it’s a template engine, it goes without saying,
If it is just purely static html and no automated tools are used, it cannot be done
You can consider using the creator tool I wrote. Put the public content of each page into the template. Use the command line to create files when creating files. You can create files with template content
If you change the title, jq provides the $.load() method to help you http://www.w3school.com.cn/jq...
I didn’t read the questioner’s question carefully just now. Let me add: include requires server support. You can deploy a server like apache to implement it. In addition, pure front-end is achievable! Pure front-end is achievable! Pure front-end is achievable! Important things to say three times 1. Use iframe reference 2. Use ajax to request html in js 3.
Compatibility
The new version of chrome firefox is no problem. IE7 is no problem. There is a problem with IE8 style. IE8+ is not compatible. There is a solution. I forgot where it is. I will look for it...
If it’s a template engine, it goes without saying,
If it is just purely static html and no automated tools are used, it cannot be done
You can consider using the creator tool I wrote. Put the public content of each page into the template. Use the command line to create files when creating files. You can create files with template content
If you change the title, jq provides the $.load() method to help you
http://www.w3school.com.cn/jq...
https://github.com/liujians/c...
The most direct method is to use js to append public html or use vue component form, such as writing a footer.vue and import it on the page you need
Is it similar to php include? You need to use templates, eg:pug
html:
jsp:
I didn’t read the questioner’s question carefully just now. Let me add:
include requires server support. You can deploy a server like apache to implement it.
In addition, pure front-end is achievable! Pure front-end is achievable! Pure front-end is achievable! Important things to say three times
1. Use iframe reference
2. Use ajax to request html in js
3.
Compatibility
The new version of chrome firefox is no problem. IE7 is no problem. There is a problem with IE8 style. IE8+ is not compatible.
There is a solution. I forgot where it is. I will look for it...