0
我有一个事件选择添加到我的引导HTML编辑器的正确的文本值。问题是,每次有一个选择的HTML工具栏被添加,所以我有很多工具栏在那里。我想在创作之前摧毁,但我真的不知道如何。该代码的外观,因为它遵循如何避免.live jquery上的乘法
$('a.open_dialog').click(function(e) {
e.preventDefault();
var tabsDiv=$('<div />').appendTo('body').load($(this).attr('href'),function(){
$('#tabs').tabs();
$('select#state').live('change',function() {
$('.textarea').empty().wysihtml5().data("wysihtml5").editor.setValue(getCustomText($('select#state').val()));
});
$("#datepicker").datepicker();
})
.dialog({
title: $(this).attr('title'),
modal: true,
draggable: false,
width: 800,
position: 'top',
buttons: {
"Speichern": function() {
open: { $(this).addClass('b') }
$.ajax({
type: "POST",
url: 'action.php',
data: $("#edit_form").serialize(), // serializes the form's elements.
success: function(data)
{
alert('Der Datensatz wurde gespeichert!'); // show response from the php script.
},
error:function(){
alert('Es gibt ein Fehler bei Daten übetragung!');
}
});
},
"Email schicken": function() {
$.ajax({
type: "POST",
url: 'mailer.php',
data: $("#contactform").serialize(), // serializes the form's elements.
success: function(data)
{
alert('Das Email wurde geschickt!'); // show response from the php script.
},
error:function(){
alert('Es gibt ein Fehler bei Daten übetragung!');
}
});
},
"Rechnung herunterladen":function() {
$.ajax({
type: "POST",
url: 'docsx.php',
data: $("#edit_form").serialize(), // serializes the form's elements.
success: function(data)
{
window.location.href ='rechnung.docx'; // show response from the php script.
},
error:function(){
alert('Es gibt ein Fehler bei Daten übetragung!');
}
});
}
},
close: function() {
tabsDiv.remove() // so I can reload again
location.reload(true);
// allFields.val("").removeClass("ui-state-error");
},
});
return false;
});
感谢我是想它不会工作,我贴孔代码 – kakuki
没问题修正它$('ul.wysihtml5-toolbar')。empty(); – kakuki
感谢您的建议我将尝试一下 – kakuki