$('#kv-error-1').bind("DOMSubtreeModified",function(){
var text = $('#kv-error-1').text();
var matches = text.split("-xar-");
$('#test').text(matches[1]);
});
$('#test').bind("change keyup input",function(){
var matchtx = $('#test').text();
matches = matchtx.split("-xbol-");
for (i = 1; i < matches.length; i++) {
bolumler = matches[i].split("-xtes-");
new PNotify({
title: bolumler[0],
icon: "fa fa-"+bolumler[1]+" fa-2x",
addclass: "bg-"+bolumler[2],
hide: true
});
}
});
我改變了這個功能,但如果我使用DOM它帶來這麼多的通知,但它必須做一次。有些事件不會讀取更改..jquery onchange等沒有檢測到輸入改變與jquery
也許把你的HTML你得到許多的通知在你的文章中。我只是在JSFiddle中嘗試了你的代碼,它工作。 – springrolls