Actually there are 2 problems: 1st I have a DIV CONTENT where I open via AJAX the content in it, the same is happening type, if I click 2 times on the same link it instead of reloading the page it is simply adding the content again getting 2 content equal in sequence
2º this same page that I carry has an accurate submit form that when I click send it do the service in the same DIV CONTENT that it has already been opened.
Below is part of the code
upload form generated by php
echo "<form action=\"$_SERVER[PHP_SELF]\" method=\"post\"enctype=\"multipart/form-data\">\n
Arquivo JPG:<br>
<input type=\"file\" name=\"vImage\" />\n
<input type=\"submit\" class=\"btn_enviar\" name=\"submit\" value=\"Enviar\" />";
script
$(document).ready(function(){
$(".btn_receber").click(function(event) {
event.preventDefault();
$.ajax({
//pegando a url apartir do href do link
url: $(this).attr("href"),
type: 'GET',
context: jQuery('#conteudo'),
success: function(data){
this.append(data);
}
});
});
$(".btn_enviar").click(function(event) {
event.preventDefault();
$.ajax({
//pegando a url apartir da action do form
url: $(this).parent("form").attr("action"),
data: 'busca=' +$("#busca").val(),
type: 'POST',
context: jQuery('#conteudo'),
success: function(data){
this.append(data);
}
});
});
});