phonegap-ratchet-demo
phonegap-ratchet-demo copied to clipboard
push call not working from javascript
Thank you for the patch but I have an issue : If you call the push method from your javascript like this :
PUSH({url: 'theme1.php', transition: 'slide-out'});
the transition to the new content doesn't work. I could see in phonegap debuger that the page is called but it doesn't apear.
It is of course working outside phonegap (on an apache web server for example)
Do you see what is going on with this one?
Found that the issue is related with Phonegap that doesn't transform the url argument into something like file:///var/mobile/Containers/Bundle/Application/APP_NAME/UUID/www/theme1.html
I could workaround by getting the root path of my app (set this into the deviceraedy event) :
var documentsDirectoryPath = decodeURIComponent(window.location.href);
appRoot = documentsDirectoryPath.substring(0, documentsDirectoryPath.indexOf("index.html"));
Then the push call should look like this:
PUSH({url: appRoot + 'theme1.php', transition: 'slide-out'});