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 –