問題が発生する可能性がありますが、私はjsonを返すサービスを持っています。ブートストラップ確認はajaxコールでは機能しません
私はそれが以下の確認コードなどのプラグインを働くstatisc記録を残す場合:
<td><strong>Fatura Abril</strong><br /> Este é um aviso de que sua fatura do mÊs 04 está vencendo</td>
<td class="text-right"></a>
<a data-toggle="confirmation" class="label label-danger" type="button" id="not-basic"><i class="fa fa-times"></i></a>
</td>
しかし、あなたが戻ってJSONを介してデータを組み立てるための機能を使用する場合、表にはmonstadaですが、プラグインの確認はしていません作業。
<script type="text/javascript">
$(document).ready(function(){
var url="phptabela.php"; // PHP File
//var url="getposts.json"; // JSON File
$.getJSON(url,function(data){
console.log(data);
$.each(data.data, function(i,post){
var newRow =
"<tr>"
+"<td><strong>"+post.titulo+"</strong><br />" +post.texto+"</td>"
+"<td class='text-right'></a> "
+"<a data-toggle='confirmation' class='btn btn-default label label-danger' type='button' id='not-basic'> "
+"<i class='fa fa-times'></i></a> "
+"</td>"
+"</tr>" ;
$(newRow).appendTo("#json-data");
});
});
});
</script>
私はこのプラグインを使用しています: http://bootstrap-confirmation.js.org/
IDは一意でなければならないため、ループ内でhtml IDを使用することは決して良い考えではありません。 – jeroen