How to import an html page into another html? [duplicate]

0

I have a home page where there is a menu that opens dialogs. Today everything is in a html only, but I would like to separate it, ie unlink and leave this html from the dialog separated from the home page .

    
asked by anonymous 08.01.2018 / 19:09

3 answers

0

If you do not want to import the js from w3schools to use the "w3-include-html" attribute that Patricia mentioned, you can do this using <iframe> of the same html. Or even use a programming language to do the "include" of a separate file (php or .NET for example) which I particularly think is advisable.

Hugs!

    
08.01.2018 / 19:36
0

Hello, you can do this using JQuery, using the load function.

Example:

$(document).ready(function() {
    $('#modal').load('modal.html');
});

Hugs ...

    
08.01.2018 / 21:38
-1

You can use the w3-include-html attribute. Example taken from link :

<!DOCTYPE html>
<html>
<script src="https://www.w3schools.com/lib/w3.js"></script><body><divw3-include-html="content.html"></div> 

<script>
w3.includeHTML();
</script>

</body>
</html>
    
08.01.2018 / 19:30