Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/401.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 这个jquery有什么问题吗?_Php_Javascript_Jquery_Mysql - Fatal编程技术网

Php 这个jquery有什么问题吗?

Php 这个jquery有什么问题吗?,php,javascript,jquery,mysql,Php,Javascript,Jquery,Mysql,我的html页面上有两个jquery脚本,其中一个加载更多结果(如分页),另一个回复用户消息,如twitter 当页面处于默认状态时,回复工作(将用户名插入文本框),但当我加载更多结果时,加载的结果不会将用户名插入文本框!!这是两个脚本 jquery的答复如下: function insertParamIntoField(anchor, param, field) { var query = anchor.search.substring(1, anchor.search.leng

我的html页面上有两个jquery脚本,其中一个加载更多结果(如分页),另一个回复用户消息,如twitter

当页面处于默认状态时,回复工作
(将用户名插入文本框)
,但当我加载更多结果时,加载的结果不会将用户名插入文本框!!这是两个脚本

jquery的答复如下:

function insertParamIntoField(anchor, param, field) {
       var query = anchor.search.substring(1, anchor.search.length).split('&');

       for(var i = 0, kv; i < query.length; i++) {
          kv = query[i].split('=', 2);
          if (kv[0] == param) {
            field.val(kv[1]);
             return;
          }
       }
    }


$(function () {
    $("a.reply").click(function (e) {

      insertParamIntoField(this,"status_id",$("#status_id"));
      insertParamIntoField(this,"reply_name",$("#reply_name"));
       insertParamIntoField(this, "replyto", $("#inputField"));



     $("#inputField").focus()

$("#inputField").val($("#inputField").val() + ' ');


     e.preventDefault();
       return false; // prevent default action
    });
});
函数insertParamIntoField(锚定、参数、字段){
var query=anchor.search.substring(1,anchor.search.length).split('&');
对于(var i=0,kv;i
loadmore jquery脚本:

$(function() {
//More Button
$('.more').live("click",function() 
{
var ID = $(this).attr("id");
if(ID)
{
$("#more"+ID).html('<img src="moreajax.gif" />');

     $.ajax({
      type: "POST",
      url: "ajax_more.php",
      data: "lastmsg="+ ID, 
      cache: false,
      success: function(html){
     $("ul.statuses").append(html);
     $("#more" + ID).remove();

        }
     });
   }
else
{
   $(".morebox").html('The End');

}


return false;


});
});
$(函数(){
//更多按钮
$('.more').live(“单击”,函数()
{
var ID=$(this.attr(“ID”);
如果(ID)
{
$(“#更多”+ID).html(“”);
$.ajax({
类型:“POST”,
url:“ajax_more.php”,
数据:“lastmsg=“+ID,
cache:false,
成功:函数(html){
$(“ul.status”).append(html);
$(“#更多”+ID).remove();
}
});
}
其他的
{
$(“.morebox”).html(“结尾”);
}
返回false;
});
});

编辑:当我加载更多帖子,并单击“回复”时,页面将被引用,因此加载的数据将再次隐藏

如果回复按钮被ajax替代,这可能是一种解决方法

$(function () {
    $("a.reply").live(click, function (e) {
      insertParamIntoField(this,"status_id",$("#status_id"));
      insertParamIntoField(this,"reply_name",$("#reply_name"));
      insertParamIntoField(this, "replyto", $("#inputField")); 
      $("#inputField").val($("#inputField").val() + ' ').focus();
      e.preventDefault();
    });
});

还有。。。如果状态id、回复名称、回复信息包含在回复按钮中,请确保在单击“更多”按钮后,每个回复按钮都存在这些数据。

回复按钮是否被ajax调用返回的html替换?如果它正在被替换。。。你附加到原始回复按钮的任何点击处理程序都将不存在。不,你会看到回复按钮DEO工作,但当我在页面上加载新帖子时,他们的回复按钮DEO不工作,就像twitter一样!,但是,即使加载了新帖子,默认帖子仍然有效!!这很有趣,因为当我加载更多数据时,我检查查看源代码以检查html,加载的帖子就不在那里了。谢谢brandon,但这不起作用,我知道回复按钮加载了信息,帖子是由相同的函数生成的!