Currently, I am developing a small web application using jQuery Mobile and PHP. One issue that I have encountered is related to an onclick event within a menu in a panel. The problem arises when trying to trigger the event after changing pages; it does not respond as expected.
Below is the code for the onclick event:
$('#searchOptionMap').click(function()
{
window.alert("map clicked ");
});
You can view the JS Fiddle demonstration here.
On page 1 - clicking on the panel menu followed by the map triggers the alert
After navigating to page 2 - clicking on the panel menu and then the map does not trigger the alert
If you remain on page 2 and click on the collapsible map, the alert appears
Interestingly, the same onclick event works outside of the panel in a collapsible set. Is there a solution to this issue that does not involve using data-ajax='false'
or refreshing the page?