Created
June 21, 2011 14:08
-
-
Save scottjehl/1037934 to your computer and use it in GitHub Desktop.
jQuery Mobile: Simple dynamic page creation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Dynamically create a page and navigate to it. | |
(and include the page in browser history ) */ | |
//create markup | |
var newPage = $("<div data-role=page data-url=yay><div data-role=header><h1>YAY!!!!</h1></div><div data-role=content><img src=http://bukk.it/yay.gif /></div></div"); | |
//append it to the page container | |
newPage.appendTo( $.mobile.pageContainer ); | |
//go to it | |
$.mobile.changePage( newPage ); |
I only got it to work without any problems with PhoneGap 1.3!
I tried both 1.3 and 1.6, same problem.
I found https://issues.apache.org/jira/browse/CB-164, hopefully a fix will become clearer.
Thank you for sharing! Works like a charm.
Thank you! Does exactly what I was looking for.
Thanks in advance, i want to replace the page. Can you upload the code for replace?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@hypept
Any luck with that? I'm getting the same problem with PhoneGap 1.2 and JQM 1.0