I am using jQuery tab library in a small application. There are 5 tabs per page, and the content for each page is loaded using Ajax. The problem is that after loading the tab, it remains in the memory of browsers (and also makes its HTML elements). Therefore, if I use, let the DIV element say with the same identifier as the previously loaded tab, all the JS function associated with this identifier tries to interact with the old tab.
In other words, let's say I have a page with two tabs "Traffic Data1", "Traffic Data2". Now first, I click on the Traffic Data1 tab, which makes an ajax call and loads the page just fine. This page has 2 date input fields, for the first field - "dateFrom", and in another field "dateTo". Next to it is the Go button. After pressing the button, the JS function displays a warning window with values ββin each of the input fields.
Now I click on the "Traffic Data" tab. The content of the page is very different, but it has the same input fields, 2 for dates (with the same identifiers) and Go buttons. When I click the Go button on this page, I see a warning window with the values ββfrom the previous tab.
So my question is: is there a way to unload the previous tab? Or is this the only alternative to using elements with unique divs (although the pages are completely separated).
thanks
source share