Open new page only the top of the main page

Asked

Viewed 55 times

0

Eae guys!

I’m a beginner in web development and would like to ask a simple question. How do I open only the top of the page. For example: I have the main page with various contents, including a menu and slide. I created a page where it will be an article for example. How to pull only this menu and slide from this main page?

Thanks for the help!

  • creates a new html file and copies from the current page the part of the code you want in this case only the menu and the slide, and also the closing of the tags that should be at the end of the code. Then open the page manually, or you can reference it through a link or a button for example

  • Your question was a bit confusing, but if you want to repeat your menu on other pages, but having only one file you can use PHP Includ. So you have the.html menu that you use PHP to do include on any page you want. If you need to change something in the.html menu it will be updated everywhere it is "included"

1 answer

0

Can you do it using the method load jQuery.

In your HTML:

Let’s assume that you already have a page with the menu and the slide and here is another page where will be loaded this page with its menu and slide.

<div id="menu-slide"></div>

jQuery:

On this other page you click inside this div (slide-menu) the page that has only the menu and slide part.

$("#menu-slide").load(pag-menu-slide.html);

More information see here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.