Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > it.comp.lang.javascript > #7948
| Path | csiph.com!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | GriS <GriS@nospam.no> |
| Newsgroups | it.comp.lang.javascript |
| Subject | Ajax ritorna l'intero html della pagina |
| Date | Tue, 5 Jan 2016 16:57:09 +0100 |
| Organization | Aioe.org NNTP Server |
| Lines | 37 |
| Message-ID | <n6gp4o$1qda$1@gioia.aioe.org> (permalink) |
| NNTP-Posting-Host | 9EZbJtr56o85v/OPcRsUgA.user.gioia.aioe.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-15; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Complaints-To | abuse@aioe.org |
| User-Agent | Mozilla/5.0 (Windows NT 6.2; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
| X-Notice | Filtered by postfilter v. 0.8.2 |
| X-Mozilla-News-Host | news://nntp.aioe.org:119 |
| Xref | csiph.com it.comp.lang.javascript:7948 |
Show key headers only | View raw
Salve a tutti e buon anno,
ho un bottone di submit a cui è legata una chiamata di questo tipo:
$.ajax({
url: "processa.php",
type: "POST",
data: dataString,
dataType: "html",
success: function(output) {
var json = $.parseJSON(output);
myform_esito(json);
},
error: function(output) {
alert('Errore');
}
});
Ad una prima chiamata, si arriva correttamente alla funzione
myform_esito(json) che è fatta così:
function myform_esito(a) {
if (a.errorStatus == false) {
...
} else {
alert('Errore nel file processa.php');
}
}
Se pèrò si entra nell'if perchè a.erroStatus è true e quindi viene
stampato l'alert indicato, alla successiva seconda chiamata (se clicco
nuovamente il bottone che manda il submit della chiamata e quindi
rilancia una seconda volta l'ajax di cui sopra) il valore di OUTPUT del
success contiene "soltanto" l'intero HTML della pagina e non l'echo del
file processa.php come invece dovrebbe essere e come correttamente
accade alla prima chiamata.
Dove sto sbagliando?
Back to it.comp.lang.javascript | Previous | Next | Find similar
Ajax ritorna l'intero html della pagina GriS <GriS@nospam.no> - 2016-01-05 16:57 +0100
csiph-web