show ("show") does not work in firefox

0

show("show") is not working in firefox. This same code works in chrome.

What would be wrong?

$('#conteudo').hide();

<?php if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { ?>
	$(document).ready(function(){ 
		event.preventDefault(); 
		$("#form").hide("slow"); 
		$("#conteudo").show("slow"); 
	});
<?php } ?>

$('#mostrar').click(function(event){
	event.preventDefault();
	$("#form").show("show");
	$("#conteudo").hide("show");
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script><aclass="btn btn-success" id="mostrar"><i class="fa fa-bar-chart-o"></i> Gerar outro</a>

<div class="form-actions clearfix" id="form">
<form action="relatorioGeralDetalhado.php" method="post" name="form1" id="form1" class="form-inline" role="form">
	<label class="inline">
		<input class="form-control" type="text" required name="date-range-picker" id="id-date-range-picker-1" placeholder="Selecione a data" data-date-format="dd-mm-yyyy" />
	</label>
	<button type="submit" id="button" name="button" class="btn btn-success btn-sm gerar"><i class="icon-save bigger-110"></i> Gerar</button>
	<input type="hidden" name="MM_insert" value="form1" />
</form>
</div>

<table class="table table-hover" id="conteudo">
tabela aqui.
</table>

What would be this error?

    
asked by anonymous 18.11.2015 / 17:10

3 answers

5

Your code has a reference error in:

$(document).ready(function(){ 
    event.preventDefault(); 
    $("#form").hide("slow"); 
    $("#conteudo").show("slow"); 
});

At this time, event is not defined.

Remove this line:

event.preventDefault();

In your click handler, change from "show" to "slow":

$('#mostrar').click(function(event){
    event.preventDefault();
    $("#form").show("slow");
    $("#conteudo").hide("slow");
})
    
18.11.2015 / 17:19
1
$(document).ready(function(){ 
    event.preventDefault(); 
    $("#form").hide("slow"); 
    $("#conteudo").show("slow"); 
});

At this point you have not yet defined event (and it does not even make sense for this event.preventDefault in the body ready).

    
18.11.2015 / 17:21
0

Hello, thank you all ... You know that moment of distraction, does things but does not pay attention to what is on the screen ... kkkk

Correct , it was quite simple.

1st) I forgot to put a else and put $('#conteudo').hide(); inside it.

2) I did not have to use event.preventDefault(); , nor do I know why I had put it ... rsrsrs

Thank you all for the great help, if it were not for you, I would not have attempted my mistake.

Thank you all!

    
18.11.2015 / 17:35