点击标签,写有Ajax的点击事件无法正确执行,Ajax请求无法发送,qiu'jie?
  更多电影 var page=2; function moremovie(){ $.ajax({ url:"http://www.imovie.com/search/title_search?page="+page+"&rows=10&query="+query, dataType:"json", type:"get", success:function(data1){ for(var index = 0 ; index<10; index++){ var data=data1.rows[index]; var html="<li><a id='detail_1_1' href='detail.html?mvId="+data.mvId+"' class='p'><img id='img1' src='"+data.mvImgUrl+"' alt='"+data.mvName+"' /></a><div class='info'> <h2><a id='detail_2_1' href='detail.html?mvId="+data.mvId+"'>"+data.mvName+"</a> / <em id='type1'>"+data.mvTypeId+"</em></h2> <p id='actor1' class='z'><span>主演:</span>"+data.mvActor+"</p> <p id='story1' class='desc'><span>剧情:</span>"+data.mvBrief.substr(1,90)+"<a id='detail_3_1' href='detail.html?mvId="+data.mvId+"' rel='nofollow'>[阅读]</a></p> </div> </li>"; $("#movieList").append(html); } } }); page=page+1; }
想要实现点击更多电影后ajax发送请求到后台读取数据展示。但点击后无法发送qing'qi

1个回答

代码太难看了 你的query 值是什么

 var page = 2;

 function moremovie() {
     $.ajax({
         url: "http://www.imovie.com/search/title_search?page=" + page + "&rows=10&query=" + query,
         dataType: "json",
         type: "get",
         success: function (data1) {
             for (var index = 0; index < 10; index++) {
                 var data = data1.rows[index];
                 var html = "<li><a id='detail_1_1' href='detail.html?mvId=" + data.mvId +
                     "' class='p'><img id='img1' src='" + data.mvImgUrl + "' alt='" + data.mvName +
                     "' /></a><div class='info'> <h2><a id='detail_2_1' href='detail.html?mvId=" + data.mvId +
                     "'>" + data.mvName + "</a> / <em id='type1'>" + data.mvTypeId +
                     "</em></h2> <p id='actor1' class='z'><span>主演:</span>" + data.mvActor +
                     "</p> <p id='story1' class='desc'><span>剧情:</span>" + data.mvBrief.substr(1, 90) +
                     "<a id='detail_3_1' href='detail.html?mvId=" + data.mvId +
                     "' rel='nofollow'>[阅读]</a></p> </div> </li>";
                 $("#movieList").append(html);
             }
         }
     });
     page = page + 1;
 }
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问