i'm using ajax form jquery plugin to submit a form (in a dialog) via ajax.
this works fine and then i get the html response back from the server. the response comes from a standard redirect-after-post php page which i cannot modify.
is there a way to obtain the url of this redirect (the final GET location) using jquery (inside the ajax callback) ?
$j('span.sfAutocomplete a').click(function(e){
var url = this.href;
var $dialog = $j('<div id="ajaxDialog"></div>').appendTo('body')
.load(
url,
'sfAutocomplete=true',
function (responseText, textStatus, XMLHttpRequest) {
$dialog.dialog({ autoOpen: true });
//
// Ajax submit
//
$j('#ajaxDialog form').submit(function() {
function showResponse(responseText, statusText) {
// how to get the redirect url ?
}
$j(this).ajaxSubmit({
success: showResponse
});
return false;
});
}
);
return false;
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…