Ich versuche, eine AJAX-Anforderung zu senden, wenn ich eine jQuery UI Dialog Save
Schaltfläche klicken und das ist, wie ich es tue:
$(function() {
var comment_dlg = $('#add_comment_dialog');
var quote_id = $('#comment_quote_id');
$('#order_push').click(function() {
quote_id.val($(this).data('id'));
comment_dlg.dialog('open');
});
comment_dlg.dialog({
title: "Write a comment",
autoOpen: false,
modal: true,
width: 600,
height: 300,
buttons: {
Cancel: function() {
$(this).dialog('close');
},
'Save': function() {
$.ajax({
url: Routing.generate('push_order_xml'),
method: 'GET',
data: { quote_id: quote_id },
cache: false
}).done(function (data, textStatus, jqXHR) {
if (data.success.length) {
alert(data.success);
} else {
alert('Something went wrong!');
}
});
}
}
});
});
Aber ich bin immer diese Fehlermeldung:
Uncaught TypeError: Illegal invocation
I Ich bin mir nicht sicher, wo das Problem liegt. Ich habe jQuery UI Dialog und jQuery $ .ajax Dokumente mehrmals überprüft und mein Code scheint richtig zu sein.
Irgendwelche Ideen?