<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題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關鍵字專題關鍵字專題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技巧

        來源:懂視網 責編:小采 時間: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.
        推薦度:
        導讀在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:

        聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。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人综合在线观看| 中文字幕亚洲无线码a| 亚洲欧洲自拍拍偷午夜色| 日本免费电影一区二区| 久久亚洲中文字幕精品一区四| 亚洲色图在线播放| 亚洲avav天堂av在线不卡| 亚洲中文字幕无码久久2020 | 免费观看午夜在线欧差毛片| 一区二区亚洲精品精华液| 无人在线观看完整免费版视频| 亚洲国产成人精品无码一区二区| 97免费人妻无码视频| 亚洲一级毛片视频| 国产一区二区三区免费观在线 | 国产免费人人看大香伊| 男男gay做爽爽免费视频| 免费在线观看毛片| 亚洲日本在线观看网址| 91免费资源网站入口| 亚洲gay片在线gv网站| 2022久久国产精品免费热麻豆| 又爽又黄无遮挡高清免费视频| 免费国产黄网站在线看| 国产va免费精品观看精品| 亚洲欧美日韩中文字幕一区二区三区| 日韩中文无码有码免费视频 | 亚洲国产成人精品电影| 午夜一级免费视频| 好吊色永久免费视频大全| 亚洲免费视频在线观看| 91香蕉视频免费| 黄色网页在线免费观看| 337p日本欧洲亚洲大胆精品555588| 免费人成在线视频| 中文字幕亚洲精品资源网| 免费网站看v片在线香蕉| 天堂在线免费观看| 亚洲精品无码久久一线| 午夜国产精品免费观看 | 亚洲av无码成h人动漫无遮挡|