- Screen name: markusweb
markusweb's Profile
9 Posts
22 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
- 18-Dec-2012 02:41 AM
- Forum: jQuery Mobile
i hae my app sofar working. there are several pages which were loaded via ajax. after some time i need to delete doese loaded pages. the loaded pages have dom-cache enabled, as during the initual/normal use of the app it is ok to cache the pages and not load them with every request.
i tried to do something like:
1) set cookie on deviceready with startingTime
2) onResume: check startingTime and when it is over timeout i will have to do the cleaning
3) changePage to homepage is working
4) deleting pages is not working!!!!
step 4 is where i am stuck now.- var timeElapsed = 0;
document.addEventListener("resume", onResume, false);
function onResume() {
setTimeout(function() {
var jetzt = new Date();
var startupTime = $.cookie('startupTime');
if (startupTime) {
var elapsed = jetzt.getTime() - startupTime; /* in ms */
var minuten = elapsed / ( 1000 * 60);
console.log('min: ' + minuten);
if (minuten > 2) {
$.cookie('startupTime', jetzt.getTime(), { expires: 1 });
$.mobile.changePage($("#homepage"), {changeHash: true});
timeElapsed = 1;
}
} else {
console.log('resume: NULL');
$.cookie('startupTime', jetzt.getTime(), { expires: 1 });
}
}, 0);
}
- $("div:jqmData(role='page')").each( function() {
console.log('remove: ' + $(this).attr('id') + ' ' + $(this).attr('data-external-page')); - $(this).remove()
});
but this is not working really well. at the end i get a bland white screen in my app. you can i delete the state of the app? i tried to move the removing to the page-show event, but this also does not work.
when i use the remove in a web-only-version it seems to work.
i now tried:- if (minuten > 2) {
$.cookie('startupTime', jetzt.getTime(), { expires: 1 });
$.mobile.changePage($("#homepage"), {changeHash: true});
setTimeout(function() {
$("div:jqmData(role='page')").each( function() {
if ($(this).attr('data-external-page')) {
console.log('remove: ' + $(this).attr('id'));
$(this).remove();
}
});
}, 1000);
}
this seems to work. the homepage is loaded, i can see in the xcode console.log that the pages are removed (at least i see the message). but then i can't click on the links on homepage. they get highlighted but no pagechange is triggered?- 14-Dec-2012 05:08 AM
- Forum: jQuery Mobile
what is the best or recommended way to do a reset of an app.
let's say i want to reset the app after 6 hours. when i change pages, which are loaded via ajax, those pages are inserted in the dom. that is good, as a second call of this page would display it directly and not load it again.
but at some point i want to have a clean start.
when i now check - eg. use a cookie to track last display times - how would i reset the app and display just the homepage/index.html?
is it enough to do a location.href? or should i use remove() to find eg. all <divs date-role='page'> which were inserted into the dom?- 07-Dec-2012 07:22 AM
- Forum: jQuery Mobile
first the facts: i am using phonegap 2.2.0, jquerymobile 1.2.0 on ios 6 with iphone 5 and iphone 3gs.
i have an application which has some local html-files that are supplied in the www folder. from the start/index.html page of the app i open those pages. there are also content which will be loaded via an ajax call that returns json which then will be converted to html and being displayed.
the new "fade" transistion looks really nice on both iphones, much better than the old slide transition with jquerymobile 1.0rc.
but i have one problem: when i click on link to open a page, either the static local html or the dynamic json ajax, the page is first displayed then there is a short flicker, kind of a refresh. a click to open a sub page is only possible after that "refresh".
in particular this flicker and delay is visible and notable with long listviews. two of the ajax content will result in long listviews. but also with small static pages, that are local in the www folder, this happens.
strange thing is, this "refresh/flicker" is mostly visisble with the heading (<hx> in content-div).
on the mobile version of this app, i have also a version which can be directly accessed via browser, there is no flicker/refresh.
can somebody guide me where to look. on the weekend i will try some pagecreation events to log to console to maybe see when this all happens.
markus- 03-Aug-2012 04:03 AM
- Forum: Developing jQuery Mobile
in jqm 1.2. there is a new feature the autodivers for listviews. so this autodivider will provide a-z headers/seperators in a listview. from the beginning of working with jqm i am missing an a-z quicksearch like in the built-in addressbook. an overlay on the right sight to quickly jump to a letter a-z.
is it possible to implement this? is there any simple solution or a plugin/extension to provide this functionality?
markus- 06-Jul-2011 04:23 AM
- Forum: jQuery Mobile
i have one problem. using jqm beta 1 (it was also there in alpha 4.1). we are in the process of updating our app and submitting it to apple's appstore. we have built an IOS app with phonegap. the next small update will support ipad (ok, not a great deal, just one or two clicks in the xcode project) and some bugfixes and layout tweaks.
as the search in list view now works fast we can also switch this feature on.it really works very well. but there is one problem, this problem is also present with version alpha 4.1 of jqm.
when we start the app and do our first click, the app will load some json-content via ajax and with the help of jquery template the html will be rendered and inserted into the page. the first click will lead to a nearly blank/black page only the spinning ajax-loading.png is shown. then - i think - after the content is loaded the index.html is displayed again and the page transition to the new page works. the grey css box is not visible. any further clicks will work. this is also the case when i load a lokal html-page which is present in the www-folder of the phonegap (version 0.94) project.
see the screenshot on http://www.wuppertal-live.de/mr/IMG_0207.PNG
- 05-May-2011 04:03 AM
- Forum: jQuery Mobile
we have created an iphone app with jquerymobile (1.0a4.1) and jquery 1.5.1 and phonegap (0.94). the back and home button/links in header work when pages are loaded from "file"/app directory. we have a few pages where we load content from our webserver via an ajax call. this works great, load data via json, using jquery-tmpl to format and display the content. the back link works but not the home-link. i have tried "./index.html" won't work. i get an "page load error". i tried "file://./index.html" don't work either.
any trick to have the home link work again?
markus- we are working on an iphone app of our website. we have a webapp/mobile-version of our website and an iphone app created. the iphone app is built with phonegap.
we are using jquerymobile 1.0a4.1 and jquery 1.5.1.
both in the webapp and in the iphone app the search box in list view is extremly slow. you have to wait several seconds after hitting a letter to have the iphone respond again. search/filter is slow.
there are three lists with search/filter box. the one with about 20 entries responds quite fast, maybe 1 second delay. the two others with over 100 entries are sloooooow.
any help without shorten the lists ?
markus- i am developing a mobile version of our website.
when i use- <script src="mobile/jquery-1.5.1.min.js"></script>
strange is, when i use the hosted version- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
i have downloaded the jquery.js different times via wget. from jquery.com and even the version from google. but in all cases i get a parse error when i try to include a local version of jquery 1.5.x.
what can i do?
markus- 08-Mar-2011 04:24 AM
- Forum: jQuery Mobile
how can i check if the app (phonegap or safari) is coming back from multitasking background state. can i force jqm to refresh or show the main index.html?
thanxs
markus- «Prev
- Next »
Moderate user : markusweb
© 2012 jQuery Foundation
Sponsored by
and others.


