Things to consider when you're using jQuery
Before you investigate using jQuery further, there are a few things you should consider.
Browsers: Desktop, BlackBerry Device Software 5.0, and WebKit 6.0 and later
jQuery is a JavaScript framework and, as such, is subject to the features that the underlying browser specifically supports. If you've already written a web application that leverages jQuery, you've likely tested a variety of scenarios on some of the more popular browsers, such as Windows Internet Explorer, Mozilla Firefox, Google Chrome, Opera, or Safari.
jQuery itself supports the most popular browsers. For information about jQuery support for each browser, visit the Browser Compatibility page on the jQuery site.
Google Chrome and Safari are both WebKit-based browsers. In BlackBerry 6 and later, the BlackBerry Browser is also WebKit-based. This commonality also means support across browsers for HTML5 and JavaScript functionality, although not all features that work on one browser will automatically work on the other.
BlackBerry Browser support
The WebKit implementation in the BlackBerry Browser inherently has a high level of JavaScript support and the majority of jQuery APIs simply work. For a list of supported HTML, JavaScript, and CSS features, visit the Supported web standards page.
One issue with any JavaScript framework is that the underlying implementations are obscured, so if functionality isn't supported it is more difficult to immediately identify. This tends to be more prevalent on the BlackBerry Browser for BlackBerry Device Software 5.0, where JavaScript support is less comprehensive than in later versions. The key reason for the lack of support is that prior to BlackBerry 6, the BlackBerry Browser was not based on the WebKit engine.
BlackBerry device
Most computers now have multiple cores, at least 2.0 GHz of processing power, and enough RAM to accomodate the most inefficiently built applications. Smartphones have come a long way, but fall short of many computer benchmarks. The differences in hardware performance between BlackBerry smartphones running various BlackBerry Device Software versions alone can significantly affect application performance.
If you're porting an existing jQuery application from a desktop, even if all features are supported, you may still need to optimize for a platform that has fewer available resources. jQuery itself is not designed to be as light a framework as frameworks such as jqlite, zepto.js, jq.Mobi, or others, and thus will come with a slight overhead in performance, even in its minified form. On the latest BlackBerry smartphones and the BlackBerry PlayBook tablet, this is much less of an issue.
Which BlackBerry Device Software versions should I support?
This question comes down to you and the application you're working on. One of the primary considerations is who your target users are.
If you have a specific customer in mind, it might be best to take an inventory of the devices they use and the minimum requirements you have to support. If you only have to support newer BlackBerry devices, you can include more features in your application, and the hardware will be that much faster. For applications that are intended to support a broader audience, your decision may be based on the prevalent BlackBerry Device Software and BlackBerry devices in the market. BlackBerry Device Software 5.0 is still a strong target for consideration, consisting of 45% of the free BlackBerry App World downloads between November 1st, 2011 and February 1st, 2012.
You may choose to implement only the most basic functionality of jQuery in your application, or implement a JavaScript version of your application specifically for BlackBerry Device Software 5.0. If your jQuery application makes use of functionality beyond the most basic features, you may need to simplify your code. Generally, there will be ways to implement your own JavaScript to re-create common jQuery functionality.
It's important to keep in mind that if you're considering using jQuery for BlackBerry Device Software 5.0, the requirements of jQuery and the capabilities of the platform may result in fewer features in your application. If you plan to develop for BlackBerry Device Software 5.0, it should be part of your application development from the start, rather than an effort to make an application based on the newest BlackBerry smartphones backward compatible. This is not only a consideration with jQuery, but with many JavaScript frameworks that leverage newer HTML5 functionalty.
For more information on the features and devices that each BlackBerry Device Software version supports, visit Choosing a Target Device OS.
UI considerations
The BlackBerry WebWorks platform leverages all aspects of HTML5, including JavaScript and CSS, providing you with standard UI components that you can use in your application. This gives you the opportunity to be as creative with your application design as you want.
However, there are times when you simply want to focus on development, and not spend too much time laying out, skinning, and tweaking various UI components.
You can use the jQuery UI library to simplify the process. This library provides you with many powerful components. However, this flexbility comes with the same considerations previously noted for using the jQuery framework in general. Specifically, there will be additional performance overhead as well as shrinking support on older platforms. There are options available that can help you minimize this overhead. jQuery Mobile can help you do this to an extent, but relies on the core jQuery framework and will be affected by some overhead as well.