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

一世执手 提交于 2019-12-10 11:13:37

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/6836499/simple-couchdb-jquery-mobile-app-loads-list-fine-in-desktop-browsers-just-not

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!