I'm just taking first steps in using jquery mobile, I copied and pasted a basic html template from the jquery site put it on a app engine demo site i have, but it does not load up properly on an iphone. I am struggling to pinpoint problem, do you guys think that this is web2py configuration problem as I thought it would just work without much hassle? any thought on including jquery mobile with web2py installation? any help appreciated, chrism.
On Feb 18, 3:27 am, Chris <partyonais...@gmail.com> wrote: > That works very well. Thanks Anthony! > > On Feb 17, 8:16 pm, Anthony <abasta...@gmail.com> wrote: > > > Maybe do something like this in a model file: > > > import os > > is_mobile_client = [code testing formobileclient goes here] > > if is_mobile_client: > > mobile_view = '%s.mobile.%s' % (request.function, request.extension) > > if os.path.exists(os.path.join(request.folder, 'views', > > request.controller, mobile_view)): > > response.view = '%s/%s' % (request.controller, mobile_view) > > For any incoming request, it checks if a '[function].mobile.[extension]' > > view exists, and if so, it sets response.view to themobileview. I haven't > > tested it thoroughly, but I think something like this would work. > > > If all of yourmobile-specific actions are restricted to a single > > controller, then I suppose you could put this code at the top of that > > controller instead of in a model file. > > > Anthony > > > On Monday, February 14, 2011 3:47:54 PM UTC-5, Chris wrote: > > > Hi all, > > > > I'm making a site on web2py that has amobilecounterpart. > > > > I'd like to be able to, once I've detected that a browser ismobile, > > > use a different set of views but share the same controller logic. I > > > saw that in an earlier post (http://groups.google.com/group/web2py/ > > > browse_thread/thread/7277e92b03450784/9dd641c956bd6bc3? > > > lnk=gst&q=mobile#9dd641c956bd6bc3<http://groups.google.com/group/web2py/browse_thread/thread/7277e92b03...>) > > > we covered the browser sniffing, > > > and got that working, but how would I be able to, for example, use > > > index.mobile.html instead of index.html if I detect the user is coming > > > from amobiledevice? > > > > Thanks > > > Chris > >