【问题标题】:jq touch id attar occurring twicejq touch id attar 出现两次
【发布时间】:2015-02-26 07:59:37
【问题描述】:
 $('#news_details').bind('pageAnimationEnd', function (e, info) {
          // get the id of the calling href
          //alert('we are here');
          var id = $(this).data('referrer')[0].id;
          //alert(id);
          $.get('http://localhost/school_app/admin/json/news_pagination.php?id=' + id, function (data) {
            // do something with the data
            //alert(data);
              $('#detail_news').append(data);
            //alert('we are here');
          });
        }); 

我正在获取这个 id 并将其传递给 #news_details 页面,它是成功的,但是当我喜欢该页面时,脚本会自动发生,当我使用另一个 id var 转到 #new_detail 页面时数据还在。

请帮帮我。

【问题讨论】:

    标签: jquery jquery-events jqtouch


    【解决方案1】:
    $('#news_details').bind('pageAnimationEnd', function (e, info) {
              // get the id of the calling href
              //alert('we are here');
              var id = $(this).data('referrer')[0].id;
              //alert(id);
              $.get('http://localhost/school_app/admin/json/news_pagination.php?id=' + id, function (data) {
                // do something with the data
                //alert(data);
                  $('#detail_news').html(data);
                //alert('we are here');
              });
            });
    

    而不是使用 $('#detail_news').append(data);

    使用 $('#detail_news').html(data);

    它会起作用的......

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-16
      • 1970-01-01
      • 1970-01-01
      • 2011-06-04
      • 1970-01-01
      相关资源
      最近更新 更多