{"comment":{"created_at":"2011-10-08T02:27:21Z","body":"@jblas thanks for the hint about the die() function, I wasn't aware of it's existence in jQuery. Yes, including that, now the problem is solved and it's working properly. You're right, multiple live handler were added when the page was loaded with ajax. ","updated_at":"2011-10-08T02:27:21Z","url":"https://api.github.com/repos/jquery/jquery-mobile/issues/comments/2330212","id":2330212,"user":{"avatar_url":"https://secure.gravatar.com/avatar/0fcad758dd8de14d5227e2c5cf64fae1?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/mathiaslin","id":295122,"login":"mathiaslin"}},"action":"created","issue":{"number":2618,"created_at":"2011-10-05T14:29:49Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"I had written this as a comment before on https://github.com/jquery/jquery-mobile/issues/450#issuecomment-2298103, but it is a separate issue actually.\r\n\r\n```changePage()``` with url parameters (data) passed in combination with back link is buggy, pageshow event handler fires multiple times. \r\n\r\nHere's what I got:\r\n\r\n- using single-page templates (each page is a separate html/jsp file)\r\n\r\n- two pages: main.jsp, car-catalog.jsp\r\n\r\n- in main.jsp, I call car-catalog.jsp as follows:\r\n\r\n  ```$.mobile.changePage( \"car_catalog.jsp\", { data: 't=model&' +new Date().getTime(), reverse: false, reloadPage: true} );```\r\n\r\n- in car_catalog.jsp, I load my content via ajax\r\n  ```$('#carCatalogPage').live( 'pageshow',function(event){ ... });```\r\n\r\n- then I go back from car_catalog.jsp to main.jsp via: \r\n  ```<a href=\"main.jsp\" data-icon=\"back\" data-rel=\"back\" data-direction=\"reverse\">Back</a>```\r\n\r\n- now from main.jsp, I open car_catalog.jsp again, but with a different data parameter t  \r\n  ```$.mobile.changePage( \"car_catalog.jsp\", { data: 't=brand&' +new Date().getTime(), reverse: false, reloadPage: true} );```\r\n\r\n- now the problem: the code in pageshow is executed twice!! Once with the data from my first page call (with t parameter 'model', and a second time with the data from my second page call (with t parameter 'brand'). This is strange, somehow jqm keeps a history of the previous page displays? \r\n\r\nIf I go back and forth a third or fourth time, the code in the 'pageshow' event handler will actually always be executed thrice or four times!\r\n\r\n- the only way to fix it is to change the back link in the car_catalog.jsp, and change it to rel=\"external\": \r\n\r\n  ```<a href=\"main.jsp\" data-icon=\"back\" rel=\"external\" data-direction=\"reverse\">Back</a>```\r\n\r\n  Only then, when I call car_catalog.jsp again, the code under 'pageshow' event handler is called only once!","comments":5,"title":"pageshow fires multiple-times (conflicts with data-rel=\"back\")","updated_at":"2011-10-08T02:27:21Z","url":"https://api.github.com/repos/jquery/jquery-mobile/issues/2618","id":1824146,"assignee":{"avatar_url":"https://secure.gravatar.com/avatar/fa72320f7fd01aa7d743768f85ccf9ea?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jblas","id":394996,"login":"jblas"},"milestone":null,"closed_at":"2011-10-08T02:27:21Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/0fcad758dd8de14d5227e2c5cf64fae1?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/mathiaslin","id":295122,"login":"mathiaslin"},"html_url":"https://github.com/jquery/jquery-mobile/issues/2618","labels":[{"name":"3 - Medium","url":"https://api.github.com/repos/jquery/jquery-mobile/labels/3+-+Medium","color":"f5b800"}],"state":"closed"},"legacy":{"issue_id":1824146,"comment_id":2330212}}