
19.07.2008, 05:00
|
|
Познающий
Регистрация: 26.10.2007
Сообщений: 83
Провел на форуме: 394231
Репутация:
50
|
|
Код:
$.fn.ajaxSubmit = function(e) {
this.submit(function(){
$("#formErrors_ajax").removeClass().addClass('ajax_message_box').text('Ждемс...').fadeIn("slow");
var params = {};
$(this).find("input[@checked], input[@type=\'text\'], input[@type=\'hidden\'], input[@type=\'password\'], input[@type=\'submit\'], option[@selected], textarea").filter(":enabled").each(function() {params[ this.name || this.id || this.parentNode.name || this.parentNode.id ] = this.value;});
$.post("./XXX", params, function(xml) {
strError = null;
oFocus = null;
$("AjaxResponse", xml).each(function() {
strError = this.getAttribute("error");
oFocus = this.getAttribute("focus");
strRedirect = this.getAttribute("redirecturl");
});
if (strError.length == 0) {
$("#formErrors_ajax").fadeTo(200,0.1,function() {$(this).html('').addClass('off').fadeTo(900,1);});
redirectu = "YES"; /*** редиректить ***/
} else {
redirectu = "NO"; /*** не редиректить ***/
$("#formErrors_ajax").fadeTo(200,0.1,function() {$(this).html(strError).addClass('ajax_error').fadeTo(900,1);});
if (oFocus) $("#" + oFocus).get(0).focus();
}
});
if (redirectu == "NO") { /*** невидно переменную redirectu ***/
return false;
} else {
return true;
}
});
return this;
}
немогу понять почему не видно переменую redirectu..
|
|
|