How do I pass a variable like username between two jQueryMobile pages?
or two regular pages for that matter, having the variable as global does not work, since at th
You can pass it in the query string as long as you disable ajax on the hyperlink between the two pages.
Next page
You miss out on the beneficial features of jQuery mobile transitions, but at least you can successfully pass variables between pages.
Update:
From the documentation:
Passing parameters between pages:
jQuery Mobile does not support query parameter passing to internal/embedded pages...
The documentation then goes on to suggest two plugins which I have not tried. Page params plugin and jquery mobile routing plugin.
Be sure to check out the documentation page linked above for their explanation on why passing parameters shouldn't work but if you load the page without the hashing (by disabling the ajax behavior) then you should be fine -- at least in my experience.