views:

251

answers:

4

Which javascript framework is most compatible with mobile phones and desktop both?

javascript disabled user of desktop are very low but mobile phone users are high and i heard not all javascript functions work in mobile phones.

+1  A: 

PhoneGap is an open source development tool for building fast, easy mobile apps with JavaScript.

PhoneGap

Another option you can go for:

baseJS

As for desktop, you know you can use any jquery, prototype, etc

Sarfraz
Will all jquery, prototype, etc's plugins work on mobile phones?
metal-gear-solid
+1  A: 

You may want to start with looking at this to get an idea what is supported on the phones you want to support.

http://www.quirksmode.org/m/table.html

On mobile phones you are going to be most concerned with download size, unless you are only targeting phones with a 3G connection, so you may want to write your own framework that is geared toward what you want, specifically.

You will want to write your phone page to work without javascript, then, if there is javascript, then you may want to have it d/l your new framework, so the basic thing that is downloaded is just a bootstrap javascript file that can d/l the real javascript file that will be used.

Your bootstrap file can look at what is available, and if, for example, onfocus is available on a div element then it is probably a desktop, so you d/l the versions that use jquery and d/l the jquery files themselves.

James Black
+2  A: 

See this question (Available iPhone Web Application JavaScript UI Library/Frameworks) for some ideas. Several answers refer to JQTouch (a jQuery plugin), which implies that jQuery may work for you.

Kevin Hakanson
so there is no single solution for both medium
metal-gear-solid
@Jitendra - If you want to go with limited functionality on the desktop you can restrict yourself to whichever least common denominator on the mobile phone you are willing to develop for, but, it will be suboptimal for PCs, which will be a problem.
James Black
+1  A: 

there is no js-framework that works on all mobile phones:

  • if your target is iphone, jqtouch does offer nice iphone-specific stuff on top of jquery
  • if you want to reach iphone and android (and possibly some other high-end handsets) you could try xui, which is a jquery-like lightweight js-framework (by one of the phonegap-guys)
  • if your goal is to work on as many phones as possible, you might want to consider building the core of you site/app in standard html and progressively enhancing it with javascript for those

hope this helps, frank

futtta