mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
Support success and error callbacks in rx_ajax submissions using iframe
This commit is contained in:
parent
f3918d792a
commit
1f1e01917e
2 changed files with 19 additions and 13 deletions
|
|
@ -351,7 +351,16 @@
|
|||
$('<iframe id="' + iframe_id + '" name="' + iframe_id + '" style="display:none"></iframe>').appendTo($(document.body));
|
||||
form.attr('method', 'POST').attr('enctype', 'multipart/form-data').attr('target', iframe_id);
|
||||
form.find('input[name=_rx_ajax_form]').val(iframe_id);
|
||||
window.remove_iframe = function(iframe_id) {
|
||||
window.XE.handleIframeResponse = function(iframe_id, data) {
|
||||
if (data.error) {
|
||||
if (callback_error) {
|
||||
callback_error(data);
|
||||
} else {
|
||||
alert(data.message);
|
||||
}
|
||||
} else {
|
||||
callback_success(data);
|
||||
}
|
||||
if (iframe_id.match(/^_rx_temp_iframe_[0-9]+$/)) {
|
||||
$('iframe#' + iframe_id).remove();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue