Simple CouchDB + jQuery mobile app loads list fine in desktop browsers, just not mobile
I'm trying to write my first Couchapp with jQuery mobile. In every desktop browser I tested (IE/FF/Chrome/Safari), the app functions exactly as intended. But when I try the same page in any mobile browser (Mobile Safari, Atomic, Android, Opera), the listview fails to populate.
At first I thought this might have to do with the mobile browsers handling my
$("#terms").listview( "refresh" 开发者_StackOverflow社区);
call differently, but changing that didn't help. I have verified that the view I am using works correctly: http://grc.iriscouch.com/dictionary/_design/dictionary/_view/byacronym.
Could someone take a look at my code and point me in the right direction?
EDIT: According to Mobile Safari's console, the script throws an error on line 34:
$db = $.couch.db("dictionary");
JavaScript Error on Line 34
TypeError: Result of expression '$.couch' [undefined] is not an object.
EDIT2: Fixed the problem by moving the jquery.couch.js
from /_utils/script
into vendor/couchapp
.
Actually, that is because IrisCouch is using your User-Agent to provide Mobile Futon, since it thinks that's the only code you'll ever need.
The IrisCouch team have been advised of this ill decision and are working on a solution. The real workaround is either:
Copy those files locally (like you did), but then you'd waste your own diskspace and lose any auto-updates they are doing
The suggested solution from CouchDB is to actually go into your Configuration page and change the
httpd/mobile_futon
property toFALSE
精彩评论