I'm still not exactly sure what my problem is, but I've detailed what is happening, what I've tried, and what I can do to kinda fix the problem below:
I'm using .mmenu Which is beautiful, but I'm running into some conflicts running it with Jquery Mobile.
The menu does not function properly when used with Jquery Mobile on the initial page load, but it will function normally if I manually reload the page, so I thought maybe something was caching, so I tried using <meta http-equiv="Pragma" content="no-cache"/>
but that doesn't work. I even tried <meta http-equiv="refresh" content="0;URL='page2.asp'" />
just as a test, and the page will still load broken, but will go into an infinite loop after you reload the page once. So apparently meta tags just aren't working on the initial page load at all.
Then I tried javascript: function LoadOnce(){ window.location.reload(); }
and put <body onLoad=" LoadOnce()">
once again, the loop doesn't begin until after I reload the page.
Is there a sure way to force the page to reload and execute my Jquery, besides hitting the reload button?
The Code
The menu link looks like this:<a href="#menu"></a>
The menu is executed like this:$(document).ready(function(){ $("#menu").mmenu();});
A number of things are happening:
- When I navigate to a new page, the menu displays as a block element,
it's supposed to be hidden, so it appears
$("#menu").mmenu();
isn't executing. - Clicking the menu icon from the new page does not open the menu, but instead tries to navigate away from the page (example: navigate from page1.asp to page2.asp, click #menu link on page2.asp and instead of sliding open the #menu on page2.asp, the page tries to navigate to page1.asp#menu)
Here is a test page where you can see the behaviour described above.
Refreshing the page makes it work, and removing jquery.mobile-1.4.3.js makes the menu work without having to refresh, but obviously breaks the structure of the site, Why would my page work after the forced reload but not on the initial load? is there an easy way to fix this that I haven't considered yet?