• <fieldset id="8imwq"><menu id="8imwq"></menu></fieldset>
  • <bdo id="8imwq"><input id="8imwq"></input></bdo>
    最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
    問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
    當前位置: 首頁 - 科技 - 知識百科 - 正文

    在html頁面中包含共享頁面的方法_javascript技巧

    來源:懂視網(wǎng) 責(zé)編:小采 時間:2020-11-27 20:40:24
    文檔

    在html頁面中包含共享頁面的方法_javascript技巧

    在html頁面中包含共享頁面的方法_javascript技巧:How do I include one HTML file inside another It's very common practice to have a consistent theme on a web site. You might have a standard navigation bar or a logo or even just a page footer with copyright and administrative information.
    推薦度:
    導(dǎo)讀在html頁面中包含共享頁面的方法_javascript技巧:How do I include one HTML file inside another It's very common practice to have a consistent theme on a web site. You might have a standard navigation bar or a logo or even just a page footer with copyright and administrative information.

    How do I include one HTML file inside another?
    It's very common practice to have a consistent theme on a web site. You might have a standard navigation bar or a logo or even just a page footer with copyright and administrative information. Rather than actually having that information on each and every page it would certainly be nice if you could write your navigation bar once, keep it in one file, and then reference that file in each of several different pages. Make a change to the navigation bar in one place and instantly all pages are updated.
    Welcome to "include" files - an incredibly powerful facility that can do this, and so much more, on your web site.

    Includes break down into two categories: client and server. A "client" side include is one performed by your browser. Unfortunately, there is no specific syntax in HTML for client side includes so we have to play a small game using javascript. A "server" side include is exactly that - the include happens on your web server so the client browser never even knows it happened.
    Server Side Includes
    We'll start with the conceptually easier one: the server side include. The specific syntax will vary based on what type of server you have and what your pages are written in.
    Simple HTML pages on most common web servers can use a syntax called Server Side Include, or SSI. As an example in an HTML file a.html we can place this line:

    The page seen by a browser viewing a.html will consist of the contents of a.html before the include line, followed by the contents of b.inc, followed by the contents of a.html after the include line. Put the HTML for your navigation bar in a file like b.inc, and all your pages can show the exact same bar.
    SSI is available on both Apache and Microsoft IIS web servers. On Apache some configuration may be needed but even if you don't have access to the actual server configuration files it can typically also be enabled by commands in a file named .htaccess that you will either find or can create in your server's web directory. Read more about Apache SSI here. Under IIS, SSI is enabled anytime you use ".asp" pages -- so the only configuration you need do is to name your pages .asp instead of .html. Read more about Server Side Include in ASP pages here.
    Another popular ASP-like programming environment is PHP. PHP's include syntax is very simple:

    Naturally, PHP has a host of additional processing ability but much like ASP the only requirement to make the include above work is to have PHP on your web server and name your file ".php".
    With all of the above approaches, the browser viewing the page knows absolutely nothing about the include - it all happened before the page was downloaded. However, sometimes processing an include on the server isn't the right option. That's where processing an include on the client comes in.
    Client Side Includes
    As I mentioned above, there is no actual syntax for a client-side include but we can mimic one using Javascript. For example:

    聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

    文檔

    在html頁面中包含共享頁面的方法_javascript技巧

    在html頁面中包含共享頁面的方法_javascript技巧:How do I include one HTML file inside another It's very common practice to have a consistent theme on a web site. You might have a standard navigation bar or a logo or even just a page footer with copyright and administrative information.
    推薦度:
    標簽: 方法 頁面 js
    • 熱門焦點

    最新推薦

    猜你喜歡

    熱門推薦

    專題
    Top
    主站蜘蛛池模板: 久久亚洲精品人成综合网| 欧美成人精品高清在线观看| 亚洲精品乱码久久久久久中文字幕 | 国产精品国产三级在线专区| 精品国产第一国产综合精品| 宅男在线国产精品无码| 精品国产免费一区二区三区| 日韩精品免费在线视频| 国产乱码精品一区二区三区中文| 亚洲精品白浆高清久久久久久 | 国产精品电影在线| 欧美一区二区精品系列在线观看| 青青青国产精品国产精品久久久久| 宅男宅女精品国产AV天堂| 日本精品久久久久久久久免费| 国产精品久久久久久久午夜片| 国内精品91最新在线观看| 久久99精品国产麻豆| 亚洲av午夜成人片精品网站| 四虎影院国产精品| 久久久精品久久久久特色影视| 国产91在线精品| 99精品电影一区二区免费看| 老司机99精品99| 日本欧美韩国日本精品| 国产偷亚洲偷欧美偷精品| 国产精品美女久久久久网| 国产99re在线观看只有精品| 91精品成人免费国产| 97精品伊人久久大香线蕉app| 精品一区二区三区波多野结衣| 久久精品中文字幕无码绿巨人| 亚洲av午夜福利精品一区人妖| 在线涩涩免费观看国产精品| 亚洲精品无码国产| 亚洲av无码国产精品夜色午夜| 无码精品国产VA在线观看DVD| 老司机亚洲精品影院无码| 精品永久久福利一区二区| 国产精品视频一区二区噜噜 | 国产精品毛片久久久久久久|