0
我需要通過php動態查詢字符串使用ajax和響應將顯示在模式框或彈出box.here我給我嘗試過的代碼集。我想要通過動態網址並顯示請求頁面的結果。請儘快解決。如何通過ajax從php傳遞動態查詢字符串,並將結果顯示在彈出框中
foreach ($files1 as $file)
{
$url='http://localhot/list1/'.$file;
$var1=$var1.'<div class="submit2"><li><a href="/localhost/list2.php?var='.$urls.'" id="test">'."submit".'</a></li></div>';
}
<script type="text/javascript">
$(function()
{
$("#test").click(function(e)
{
var link=$(this);
e.preventDefault();
$.get("/localhost/list2.php?var="+link.attr('id'),function(response){
$("#ajaxresponse div").fadeOut("fast", function()
{
$("#ajaxresponse div").html(response).fadeIn();
});
});
});
});
</script>
您是否收到任何錯誤? –
不,我沒有得到任何錯誤 –
試試這個http://stackoverflow.com/questions/15862109/jquery-ajax-call-empty-querystring/15862289?noredirect=1#comment22642458_15862289 –