0
Ol, I’m doing a content load other pages without updating the masterpage with AJAX as follows:
Line that I click
<li id="pag1">Pag1</li>
Script
$("#pag1").click(function(){
$.ajax({
type :"POST",
async: false,
url: paginadeconteudo.php",
}).done(function(data){
$("#conteudo").html(data);
});
}
Until then everything 100%, it loads the page inside the other, loads the styles and everything, but does not load or call Jquery. For example in the mask in an X field. If I use this in the header of my master page, content can’t run, someone can explain why?
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.11/jquery.mask.min.js"></script>
<script>
$("#cpf").mask("000.000.000-00");
$("#tel, #tel2").mask("(00) 00000-0000");
</script>
EDITED:
This is an example of my code. the Page I’m calling n gets the same if I already reference directly within it. It gets paid if I enter the page and update, but if I leave and go back to work, it is as if ref. did not exist.
BS.: Try testing on a page . html local I think running from here is bugged!
<!DOCTYPE html>
<html>
<head>
<title>teste</title>
<style type="text/css">
.pagina {
max-height: 200px;
background-color: white;
color: black;
}
.menu {
max-height: 200px;
background-color: black;
color: white;
}
</style>
</head>
<body>
<div class="menu">
<button class="add-usuario">CHAMAR PAGINA</button>
</div>
<div class="pagina" id="conteudo"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script type="text/javascript" src="meudiretorio/meuajax.js"></script>
<script>
$(".add-usuario").click(function() {
$.ajax({
type: "POST",
async: false,
url: "https://www.doraziosportes.com.br/cadastrarusuario.php",
}).done(function(data) {
$("#conteudo").html(data);
});
});
</script>
</body>
</html>
Your question is very confusing, but on all pages that use jQuery you will have to insert the jQuery files by following the positions (1º - jQuery, 2º - plugins using jQuery).
– LeAndrade
Obg, but I’ve done all the jquery references
– Marcos Vinicius Leão