HTML uses a common head navigation

Source: Internet
Author: User
Write the company's official website, found that the navigation and carousel every page has, the first thought is to use Vue routing to achieve, and then take into account the SEO problem, need to use NUXT, and then think of the trouble is no use, and then think of the IFRAME (but the IFRAME has blocked the loading of the page and other shortcomings, Not used)
Let's say the IFRAME automatically adapts to the height of the problem
Add the following code to the sub-page :

    var oIframe = window.top.document.getElementById("mainiframe");    var oBody = document.getElementsByTagName("body")[0];    oIframe.style.height = oBody.offsetHeight + ‘px‘;

If the iframe on the main page is dynamic, the main page needs to add the following code:

   function loadPage(path) {        document.getElementById("mainiframe").src = path    }

Finally, we used the JQ load.
However, when the load is accessed locally, there are cross-domain issues that need to be accessed on the server, or the error is as follows:

The Load method is as follows:

   function loadPage(path) {        $(‘.page‘).load(path)    }

HTML uses a common head navigation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.