0
I am using this code to update a div of the page by clicking the button
<div id="campo"></div>
function atualiza_campo_usuario(){
$("#campo").load("http://site.com");
}
But what happens is that sometimes updates and sometimes does not update, just update by clicking 2 times,and this ends up disturbing,I need every time there is one clik
, the content of the div
.
Note: I make it clear that the button that updates the content of div
, gets into a modal
that is rescued through a iframe
.
Rents, can you [Edit] the question and add more code? If you put one
console.log('click');
within that functionatualiza_campo_usuario
log appears every click or you need to double-click?– Sergio
Can you add the button code? When you add the click event to the button?
– Carlos Martins
Taking into account that you add the event to the button, onclick or click on the page load with javascript, specifically, before loading your content, clear the div: $("#field"). Empty(); But it would be very interesting to see the code of your button.
– Aline