page shows duplicates when back button pressed

page shows duplicates when back button pressed

Hi ,

I have a multi page application using jquery mobile ,like page1,page2,page3,page4.

Here page3 generates dynamical list which populates on basis of database and when list item is clicked ,it navigates to page4 using "$.mobile.changepage".

Until this step everything goes fine,but when i press back button in page4,on page3 listitems are doubled in number and getting added to the existing list.

I don't know what to do.Any help regarding this problem
  1. for(var i=0;i<result.length;i++){
  2. var li = $('<li/>').html(result[i]+' ').append('<br>'+'$'+price[i].resultSet[0].price);
  3.        li.append($('<hr>'));
  4.       
  5.         $(#result).append(li);

  6.        $('#result').listview('refresh');
  7.    
  8. }