Split my Cod HTML into separate HTML’s

Asked

Viewed 29 times

0

Good morning.

I’m an Internet systems student and a beginner. My site is cool but it is difficult to manage the contents because it is too big.

I would type write coarrousel in separate HTML and call it, then modal, and so on.

Ae would edit the separate contents.

How do I call HMTL and embed it in the index page?

1 answer

0

If you have html files and want to insert them into another page, you can use Jquery for this. Here’s an example:

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
   
   $('#inserir_pagina').load("meu_arquivo.html");

});
</script>
</head>
<body>

<div id="inserir_pagina"></div>

</body>
</html>

  • Can’t call I added the script Jqueryy I already call <script> $(Document). ready(Function(){ $('#inser_pagina').load("contact.html"); }); </script> then put the div where I want to call the other html <div id="insert_pagina"></div> But it didn’t work <script src="node_modules/jquery/dist/jquery.js"></script> <script src="node_modules/Popper.js/dist/umd/Popper.js"></script> <script src="node_modules/bootstrap/dist/js/bootstrap.js"></script>

Browser other questions tagged

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