I would like to make a page just like it does with Razor MVC (_Layout)
with header, and footer, and make the inclusion of it on other pages, how could I do that?
I want to make AJAX Load Content
Here's the example I did:
_Layout.html
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<title>Treinamento</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1">
<link rel="stylesheet" href="css/jquery.mobile-1.3.0.min.css">
<script src="js/jquery.js"></script>
<script src="js/jquery.mobile-1.3.0.min.js"></script>
<script src="js/controle.paginas.js"></script>
<script>
//exemplo do marcos vinicius
$(function () {
$("conteudo").load("pagina_teste.html");
});
</script>
</head>
<body>
<!--inicio da página de cardápio-->
<div id="cardapio" data-role="page">
<!--cabeçalho-->
<div data-role="header" data-theme="e" data-position="fixed" data-id="vs.header">
<h1>Cardápio</h1>
<a href="#home" data-transition="fade" data-icon="back" data-iconpos="notext" >Home</a>
</div>
<!--cabecalho-->
<!--conteúdo-->
<div data-role="content" id="conteudo">
<P>adicionar o conteúdo de todas as páginas externas </P>
</div>
<!--conteúdo-->
<div data-role="footer" data-position="fixed" data-theme="e" data-id="vs.footer">
<div data-role="navbar">
<ul id="nav">
<li><a href="pagina_teste.html" data-icon="home">Página de Teste</a></li>
</ul>
</div> <!--fim do navbar-->
</div> <!--fim do footer-->
</div> <!--fim da página-->
</body>
</html>
pagina_teste.html
<p>esté é o conteúdo da página</p>
control.paginas.js
$(document).ready(function () {
$('#conteudo').load('conteudo/pagina_teste.html');
$('ul#nav li a').click(function () {
var page = $(this).attr('href');
$('#conteudo').load('conteudo/' + page + '.html');
return false;
});
});