I'm developing a system using PHP
, with the idea of having only one page. As? (I do not know if it is the best solution, I believe it is not), I developed a side menu that is fixed and the contents to be changed would be in the center of the page, the side menu contains some links:
<li class="treeview">
<a id="menuPerfil">
<i class="fa fa-user"></i>
<span>Perfil</span>
</a>
</li>
When I click on this link, I load a html
file that contains a simple form according to the clicked menu link.
I made a script
jQuery
using the load()
function:
$("#menuPerfil").click(function () {
$('#principalContent').load("formPerfil.html.twig");
});
As links are clicked, a given html
is loaded. However,% wc% loaded by the html
load function can not access something that is in the index, for example a jQuery
of tag
, it's like loading twig
independent of index, not just including it .
I wonder if anyone knows a way to solve using the html
function, since it does not accumulate the .load()
files loaded on the same page, or some other way to properly load those data, without have to make a different page for each system functionality.
NOTE: I use html
, PHP
and twig
in the project.