loadData() 関数を使用して PHP スクリプトからデータを取得し、別の関数を使用してデータベースから検索します。すべて正常に動作しますが、検索結果をクリックすると、データが読み込まれません。これが私が使用しているjquery関数です。
//Gets Data
function loadData(id)
{
loading_show();
$.ajax({
url: "load_data.php",
type: "post",
data: "id="+id,
success: function(data){
loading_hide();
$("#container_wrap_metro").html(data);
},
error:function(){
alert("failure");
$("#container_wrap_metro").html('Unable to process request!');
}
});
}
//Search
$(function(){
$("#result").keyup(function(){
var q = $(this).val();
$.get("results.php?q="+q, function(data){
if(q){
$(".side_container").html(data);
}
else {
$(".side_container").html("");
}
});
});
$('#b').live('click',function(){
var page = $(this).attr('p');
loadData(page);
});
});