0
am giving a load() on my div, but it always disables jquery commands as soon as it load! Any solution???
$(document).ready(function () {
$('#form_campo').on('submit', function() {
$.ajax({
url: 'matriz/salvacad.php',
type: 'post',
data: $('#form_campo').serialize(),
success: function(data) {
$('.erase').click();
$(".menu").load(location.href + " .menu > *");
}
});
return false;
});
jquery function in another file is
$('.cat').click(function (e) {
e.preventDefault();
$('.categoria').fadeToggle("fast");
$('.menu').fadeOut('slow');
});
$(".close_red").click(function(e){
e.preventDefault();
$(".categoria").fadeOut('fast');
});
but only works before Reload, or giving a refresh on the page
<div class="menu" id="menu">
<div class="menux cat">Categoria</div><br>
<div class="separated"></div>
<?php
mysql_set_charset('utf8');
$mostra = mysql_query("SELECT * FROM categoria" )or die (mysql_error());
$ver = mysql_fetch_array($mostra);
$status = $ver["categoria"];
if (empty($status)){
echo('');
}
else{
echo('<div class="menux camp" style="margin-top: 10px; ">Campos do Produto</div><br>
<div class="separated"></div> ');
}
?>
<div class="menux prod" style="margin-top: 10px; ">Produtos</div><br>
</div>
You want to load a url (http://localhost.menu. > *) into the menu class?
– adventistaam
@Ricardopunctual the result does not come from $_POST, it is only the result that appears in an sql query, I will edit for you to see
– Evandro Aguiar
@adventistaam even that, comes from a localhost,
– Evandro Aguiar
Tried to use an append?
– adventistaam
the help of @Ricardopunctual worked, however my form disabled the Submit after load tbm
– Evandro Aguiar