English 中文(简体)
TelephoneGap / JQuery Mobile db 壳牌问题
原标题:PhoneGap / JQuery Mobile dbShell questions

我试图每当用户在电话交换机上翻一页时就进行询问。 我是新来的电话/快乐移动电话,但没有了解正在发生什么。

当我点击一个顿子时,改动前的页数是两次。

它第一次正确运作。 接下来的电话是没有剪辑的。 交易,没有错误。 因此,如果我先点击总页,那一页就行了,但另一页没有。 如果我先点击另一页,总页就没有工作。 在这两种情况下,重新审视同一页并不重复提问。

这里的情况如何? 这对我所说的话来说,必须是不正确的?

//Listen for any attempts to call changePage().
$(document).bind( "pagebeforechange", function( e, data ) {
    alert("pagebeforechange");
    // We only want to handle changePage() calls where the caller is
    // asking us to load a page by URL.
    if ( typeof data.toPage === "string" ) {
        // We are being asked to load a page by URL, but we only
        // want to handle URLs that request the data for a specific
        // category.
        var u = $.mobile.path.parseUrl( data.toPage ),
            reOverviewPage = /^#overviewPage/,
            reViewByType = /^#viewByType/,
            pageUrl=data.toPage;
        var params = parseParams(pageUrl.substr(pageUrl.lastIndexOf("?") + 1));
        if ( u.hash.search(reOverviewPage) !== -1 ) {
            alert("overview");
            dbShell.transaction(function(tx) {
                alert("doing query");
                 tx.executeSql("select _id, description from area where _id=?",[params[ id ]],renderOverview,dbErrorHandler);
            },dbErrorHandler);              
        } else if (u.hash.search(reViewByType) !== -1 ) {

            alert("viewByType");
            dbShell.transaction(function(tx) {
                try 
                {
                    alert("!");
                    tx.executeSql("select trip.* from trip, trip_type, trip_type_lookup where trip_type.trip_id = trip._id and trip_type_lookup._id = trip_type.trip_type_lookup_id and lower(trip_type_lookup.type_name) = ?",[params[ type ]],dbErrorHandler, renderViewByType);
                } 
                catch(e) 
                {
                    alert(e.message);
                }

            },dbErrorHandler);
        }
    }
});
问题回答

暂无回答




相关问题
Javascript data store solution using PhoneGap

Does anyone have any experience of storing data in JavaScript across all mobile platforms using PhoneGap? My ideal solution would be to use something like SQLite, but unfortunately SQLite isn t ...

get image from iphone, using phonegap camera api

I m new to Xcode and iPhone apps. I want to select an image from iPhone (camera or library) and send to php via ajax. http://wiki.phonegap.com/iPhone:-Camera-API I m using the phonegap framework, ...

Getting Search Keyboard on iPhone using PhoneGap

I have created a search field on a mobile app i am creating via PhoneGap. I ve tried using with no luck. I also know that i could get around the visual aspect of the input field via CSS & ...

How can I detect a shake gesture in PhoneGap 0.8?

I m using PhoneGap 0.8 and I d like to detect a basic shake gesture. I ve found two relevant snippets: http://groups.google.com/group/phonegap/browse_thread/thread/25178468b8eb9e9f http://phonegap....

How do I fix PhoneGap build errors?

I am trying to build a PhoneGap-based iPhone application, but I keep getting the following two errors: ./build-phonegap.sh: line 6: ./configure: No such file or directory cp: lib/iphone/phonegap-min....

热门标签