2015-02-26 3 views
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').append(data); 
      //alert('we are here'); 
      }); 
     }); 

Я адресность этого идентификатора и передать его на страницу #news_details, она успешно, но когда я хотел страницу сценарий происходит atomatically по его self.and, когда я дойдя до # new_detail page whit another id var предыдущие данные все еще существуют.
, пожалуйста, помогите мне.JQ tounch идентификатор Аттар повторяющимся дважды

ответ

0
$('#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);

это сработает ....