<a>
問題は、Ajaxgetから作成されたタグに対してクリック関数でJQueryを実行する必要があることです。自分に合った答えが見つからないようです。
$("#get_button").click(function (e) {
$.ajax({
type: 'GET',
url: 'http://someurl.com/apikey=1234124124',
dataType: 'jsonp',
success: function (data) {
newRow = "<a id='some_id'>test</a>";
$("#table_id").append(newRow);
}
});
});
$('#some_id').click(function (event) {
event.preventDefault();
alert('this will pop up if it worked');
});
明確にするために編集:私のコードには、some_idのIDで追加された複数の行がありますが、それを表示するのを忘れました。