How do I embed one HTML page into another without iframe?

Asked

Viewed 1,806 times

1

I have a common page but inside a body in a div want for a li or a p other html, so I have a main page in case I need to make changes and have external content. No need to change all pages when I insert a new link in the menu, for example. I read about and import in the link tag but could not put. someone can help me?

  • Usually web frameworks give you this option when you use some server-side programming language. Do you intend to use any or want to simulate this with Javascript? Incidentally, with Angular this is also simple, with jQuery and others I no longer know.

  • 'Cause you can’t use iframe?

  • @Genos pq is inside a frame, it is not so responsive. or I do not know how to make it as good as direct

1 answer

1


Fala Guilherme,

you can use jQuery’s load() function

$( "#ul" ).load( "pagina-com-o-ul-modificado #ul-menu" );

http://api.jquery.com/load/

And as Jbueno said, there are several frameworks that have support for this, it will depend on the language you will use.

  • 1

    This resolves. thank you very much, helped immensely!

Browser other questions tagged

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