I need to use JavaScript in a form for mobile web application.
I need some information about it, related to browser compatibility as well as way to use JavaScript in mobile web applications (syntax).
It's a nightmare. It's like working with web-browsers in the 90's but with the manager expectations of tomorrow.
I strongly recommend you determine your target platforms in terms of regions, software, and actual hardware since the market is much more fragmented than the web and a large number of mobile devices have issues with CSS, JS and even XHTML ranging from painful to not-on-this-platform.
The good news is that android and iphone are pushing the field rapidly. The bad news is that makes a lot of the sources you'll google badly out-of-date.
Some references:
http://www.w3.org/TR/mobileOK-basic10-tests/#test_objects_or_script
http://mobiforge.com/developing/story/getting-started-with-mobile-ajax
http://mobiforge.com/
Especially that last one :)
The reality have changed since this question was asked. Modern smartphones support browsers, that are compatibile with their desktop big brothers, with same JavaScript support. However, still there are differences how application is displayed and how it is operated, you can't rely on drag-and-drop, there are some rendering differences, f.g. in GWT-Ext Showcase on Opera Mobile tab close buttons are not rendered. So you should not rely on modern JavaScript 'magic framework' such as Ext.
Agree with the "it's a nightmare" comment.
Some tips:
For simple scripts, go right back to JavaScript basics - no JS frameworks - think document.getElementById();
Always make sure your JavaScript is valid. If you have an object, make sure you have commas and semi-colons in the right place. An easy way to check this is in Internet Explorer - check in the bottom left for the valid or invalid JavaScript icon.
Make sure your Javascript is XML valid - Blackberry's won't like it if it's not.
For something more complex, check out jquery mobile: http://jquerymobile.com/ - some nice stuff in there.
I would recommend you to use new framework for mobile web applications Sencha http://www.sencha.com/
This framework supports wide range of mobile platforms like Adroid, iPhone and others...
Good luck,
Yevgeniy V.
Softjourn Inc.
Software developer.
Another good solution to target multiple devices (IPhone, Android, BlackBerry, Bada ...) and take advantage of innovative components is to use the JavaScript Toolkit Wink.
Khushi,
I have just founded a framework called PhoneGap, you build your whole app using javascript, html5 and css. You even can play with device native features.
Take a look at for more information http://www.phonegap.com/about .
Totally agree with annakata,
It is a minefield trying to work with JavaScript on a mobile phone in fact we(I work for a mobile agency) tend to recommend to clients that you don't use JavaScript in your mobile pages.
If you have to use JavaScript then look into
WURLF - http://wurfl.sourceforge.net/
MobiForge - http://mobiforge.com/
MobileElements - http://www.mobileelements.com/
And I would recommend creating an iPhone only site that has all the cool functionality and then a plain site for everyone else so that it works well for them.
Also remember you can use device anywhere for testing on multiple phones as well
You may know Patrick H. Lauke, who wrotes the quirksmode blog. He started to work with mobile phones in the not so recent past.
He is publishing his work on the same website in the same wonderful quality of his.
Browsers in the new mobile phones are getting better, that's true, but unfortunately even crazier bugs are popping up.
Not all are javascript related, but you could check his mobile pages at:
http://www.quirksmode.org/mobile/
Related
Im working on a mobile optimised site. Im using media queries to detect the screen size and the majority of the content is still shown just formated differently.
The site has some JavaScript reliant interactive tools. What if any are the accessibility concerns for using JavaScript with mobile devices?
On desktop, non JavaScript users see a static list of the same information the interactive tool uses. I was thinking of the same solution for the mobile version but I guess im interested in more general answers for other situations as Ive not ready anything about accessibility and JavaScript specific to mobile.
Thanks
I would say the same rules apply wouldn't they? Some users may have js turned off, you never know.
Mobile or not, it's still on the web and needs to work regardless of js.
Most screen readers work on the DOM. Properly written Javascript can really help accessibility (just like properly written CSS & HTML).
Not working with Javascript enabled is more of a problem for security conscious folks than it is for most screen reader users. That being said, a progressive enhancement approach will ensure that your content is available to the widest range of people.
The older WCAG 1.0 Mobile Guidelines - http://www.w3.org/WAI/mobile/
A Newer WCAG 2.0 set of Mobile Guidelines - http://www.funkanu.se/en/About-Funka/News/News-archive-en/Mobile-accessibility-guidelines/
I am thinking of building an application, kind of like TiddlyWiki in the sense that everything is self-contained in an HTML file, or at least in a bundle where a user won't have to install anything. It works on just about any browser, and on mobile phones (Android and iPhone), and in some browsers (e.g. Firefox), manages to save to the local filesystem without a plugin (albeit, it launches many security warnings, but there are other solutions for that). Other browsers happen to use a Java plugin to bypass this restriction.
Are there any technologies that exist that make this possible? HTML5's web storage sounds like it would be almost perfect, except that the data would be tied to the browser.
Any assistance would be appreciated (even if that just means editting / retagging the question to get more folks looking).
Whats about the fileapi: http://caniuse.com/#search=fileapi
I am just adding a relevant comment with this but not exactly an answer...
When you are saying that you want to develop application which contains everything... Then I would like to add about Titanium, PhoneGap, and others (Corona)...
This softwares provides JavaScript base which will be running on all the mobiles (if mobile applications), desktops (if desktop applications) and so on.... But Titanium (as i am working on it) works on the SDK of all the other languages for development...
Now TiddlyWiki, what i have understood from the link is that it is creating a web application or something like that which will work on all the other mobile devices. But this is NOT Good always, Since some application needs to be a NATIVE environment (which is supported by Titanium). Native applications will be much more faster than any other developed applications..
I need to develop a website that work on Blackberry.
Please suggest me the things which I should keep in mind to develop website on Blackberry and what all things are required to develop website for mobile (like public IP etc)
Following things are required in the website Please let me know how much these will be supported on Blackberry Browser:
Geolocation.
Google Maps API.
temporary local storage (for text data).
Ajax.
Please let me know how much HTML5 support is available on Blackberry Browsers.
Thanks in advance
As far as I know, Ajax is supported with the Blackberry Browser. You most likely won't be able to do everything in a fancy way, so be wary of that. I've also noticed that there are a ton of CSS limitations too.
Also keep in mind that some Blackberrys only support up to certain version of CSS, Javascript etc. There are lots of documentation on what is and what is not supported. Here is an example:
General overview of the Javascript supported
What is your background concerning web development? Regardless of your skill you should take a look at these two links.
Mobile best practices
This is a must read for anyone serious about developing for the web. There are so many experienced developers who don't follow these essential practices.
Yahoo! Best practices
What is the best client side library (framework) for creating web-based applications (not phone specific appsfor modern smartphones (WEbkit compatible).
I 'm mostly thinking of a modern, light JavaScript framework that is specially designed to work with modern Web-kit enabled smart phones.
I heard http://jquerymobile.com was pretty good any suggestions or comments..
JQuery's is the only big new thing I'm aware of. Also keep in mind, jq-mobile is more of a widget library. You still have to use the JQ core as a dependency. The rash of new smartphones and platforms to deal with has pretty much turned things into the wild west for web UI devs.
Fortunately most modern Android and iPhone browsers are pretty close to their desktop equivalents. I even found as-you-go testing in Windows Phone 7 with IE 8 in IE 7 mode to be a pretty good indicator of what things would look like in a Win Phone emulator but I don't think we should encourage Microsoft by supporting their outdated-at-release mobile garbage browsers before they capture market share, which will hopefully light a fire under their butts to get it right on their next mobile browser.
Since the general practice at the moment seems to be to keep things very simple and we don't really have to branch for IE for a change, the two biggest reasons to use a framework in the first place have been removed, although JQ-core is light enough for modern smart phones, IMO, and it can save some development time if you have a fair amount of behavior to build
Does javascript work on mobile phones?
Which mobile phones?
There's some pretty good information on this site:
http://www.quirksmode.org/m/table.html
depends on the browser
Some. Do you have a specific model in mind or just in general?
Depends on what mobile phones and to what extent you need support.
Smart phones pretty much all include support for JavaScript. How well they support them is another story.
You can see a lot of what mobile devices support here: http://www.quirksmode.org/m/table.html
In general I would assume that javascript isn't there, as older cellphone models may not support javascript, but, if you use unobtrusive javascript and graceful degradation, then it won't really matter, as your page will function in some known way on any device, as long as it is formatting itself properly.
So, if you want to have it work on all mobile phones, then start with not needing javascript, then add in the javascript as an enhancement.
Bare in mind as well that their are different versions of JavaScript supported by different phones and different browsers, even if JavaScript is available.
http://www.skyfire.com/ if you can get that browser on it then you can get javascript! Awesome browser and quite portable...
Works on Symbian (Nokia Phones use it) and Windows Mobile.
I think javascript is totally browser dependent. Symbian mobile surely can run javascript. Smart phones are much smarter to handle javascript.