<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乱码在线观看| 波多野结衣在线免费观看| 亚洲精品国产肉丝袜久久| 免费精品国产日韩热久久| 亚洲小说图区综合在线| 亚洲美女视频免费| 亚洲av永久无码精品国产精品| 免费黄色网址网站| 亚洲av无码成人精品国产| 亚洲偷自拍拍综合网| a色毛片免费视频| 久久久久亚洲AV无码观看| 亚洲一区二区女搞男| 老汉精品免费AV在线播放| 亚洲人成图片网站| 亚洲天堂免费在线视频| 在线观看91精品国产不卡免费| 一级a性色生活片久久无少妇一级婬片免费放 | 免费的黄色的网站| 亚洲午夜福利AV一区二区无码| 又爽又高潮的BB视频免费看| a级毛片毛片免费观看久潮| 成人午夜免费视频| 日韩电影免费在线观看网址| 牛牛在线精品免费视频观看| 亚洲黄色中文字幕| 亚洲欧洲日韩综合| 亚洲中文字幕无码中文字在线| 99久久久精品免费观看国产| 四虎成年永久免费网站| 天天影视色香欲综合免费| 日本三级2019在线观看免费| 亚洲中文无码永久免费 | 四虎影视永久免费观看网址| 91制片厂制作传媒免费版樱花| 成年大片免费视频播放一级| 免费人成视频在线观看免费| jizz中国免费| 亚洲一区欧洲一区|