Simple CouchDB + jQuery mobile app loads list fine in desktop browsers, just not mobile
Asked Answered
L

1

2

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" ); 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.

Launderette answered 26/7, 2011 at 20:55 Comment(1)
Hi Sam! Welcome to stackoverflow - I'm glad you were able to fix the issue. Feel free to answer (and accept) your own question - that way when users Google or have the same issue, it's easy to find. I edited your post to help with the formatting as well. :)Calaverite
R
3

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:

  1. Copy those files locally (like you did), but then you'd waste your own diskspace and lose any auto-updates they are doing

  2. The suggested solution from CouchDB is to actually go into your Configuration page and change the httpd/mobile_futon property to FALSE

Rainer answered 28/11, 2011 at 16:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.