クリックするとモーダルを開くリンクがありますが、その要素にはdata-id = "#id here"属性もあり、処理のためにphpスクリプトに渡すために取得する必要があります。どうすればこれを達成できますか?
私のJSコード:
$(document).ready(function() {
$('#edit_general').click(editModal);
});
function editModal(event)
{
var modal = $('#editModal');
modal.modal({
show: true
});
}
私のhtml:
<li><a id="edit_general" href="#editModal" data-uid="<?php echo $u->id; ?>">Edit General</a></li>
thisキーワードを使ってみましたが、うまくいきませんでした。どうすればこれを達成できますか?