0
Code:
<button id="click" class="button"></button>
<div class="TableCSS">
<table id="clickvent">
</table>
</div>
$(document).ready(function(){
$("#click").click(function(){
if($("#clickvent").is(":visible")){
$("#clickvent").hide();
} else{
$("#clickvent").show();
}
$.ajax({
url: "../Conteudo/click.html",
cache: false,
dataType: 'html'
})
.done(function(retorno) {
$("#clickvent").html(retorno);
})
.fail(function() {
alert("Algo está errado");
});
});
});
It’s calling all right but when I click the button you need to double click to load the content of the page click.html
. Can anyone tell me the error ? And only by pressing for the first time happens that you have to click twice, to hide the content is normal just to load that happens.
are you sure that’s the problem? Because apparently you hide/show the
#clickvent
when you click.... comments this ifif($("#clickvent").is(":visible"))
and see if it solves the problem...– Marllon Nasser
I commented but there does nothing. Not an action when you click the button.
– KevinF