A while back, I built a website for a client using jQuery 1.3 because I needed a slide-show widget for the homepage. More recently I’ve been using ExtCore for small website widgets – mainly because I’m a bigger fan of ExtJS than jQuery. (ExtCore also didn’t exist at the time I built that website).
Long story short, this particular client (a restaurant) asked me to add some new content to their menu. Rather than expecting the user to scroll down a lengthy list of mouthwatering lunch options, I suggested that we add tabs to the menu in order to logically separate the menu items.
Since I already had jQuery 1.3 running the slide-show on this website I simply decided to build the menu tabs in jQuery to maintain consistency. But I was suddenly struck by an idea: why not compare how ExtCore and jQuery UI create tabs from HTML markup!
ExtCore
ExtCore can be downloaded from the ExtJS website, and an online demo of the simple tabs can be seen here.
The first step to building tabs from HTML markup using ExtCore is to reference ext-core.js in your page header. You also need to include the tabs.css file and the “images” folder containing the necessary 5 background images. (These can be found under “/examples/tabs/” of your ExtCore download ZIP.)
Note: I’m using ExtCore 3.0, although I believe 3.1 is available for download.
Next, we need to add the appropriate HTML markup for our tabs. Here’s a quick example.

As you can see from the picture above, ExtCore takes a wrapping DIV element (class “tab_container”) and converts a nested unordered list into the tabs. Subsequent child DIV elements contain the markup for each tab’s content. (The source code in this example is taken directly from the ExtCore tab example.)
The only thing to notice is that each DIV element has a CSS class assigned to it – these classes are essential to proper tab theming. The DOM ID properties are used to click back-and-forth between tabs.
Lastly, you need to include a JavaScript snippet which converts your HTML markup into a fancy tabbed widget:

jQuery UI
jQuery UI has a tab widget which is dependant on the larger jQuery library. An online demo of their tab widget can be seen here.
The first step to using tabbed content with jQuery is to reference:
- jquery-1.3.2.min.js
- jquery-ui-1.7.2.min.js
Your file versions may differ (I think jQuery 1.4 was just released), but these are the versions I’m using. I’m also using the “smoothness” theme – for some reason jQuery UI would not allow me to download the package without specifying a theme. (That may affect my analysis for speed in the next section.)
You will also need to include the CSS file and images folder included with your download of jQuery UI. In my case, it’s jquery-ui-1.7.2.css and an “images” folder containing 13 background images.
Next, write your HTML markup:

Compared to ExtCore, jQuery UI expects less HTML markup as we lose several layers of nested DIV elements. The most obvious difference between jQuery UI and ExtCore is probably that jQuery UI doesn’t need the extra CSS classes applied to the DIV elements.
Next, we add our JavaScript snippet:

Again, jQuery UI expects less code to generate the tabbed widget.
A Deeper Look
Let’s take a look at the file sizes for each library. This is about as un-scientific a study as it can get; I’m using Firebug’s “Net” tab to grab file size and download speed numbers. These numbers will probably be different for you because of any number of factors… but you get the idea.
As I already mentioned, ExtCore requires 1 JavaScript file, 1 CSS file and only 5 background images:
- ext-core.js (78.9 KB, 156ms)
- Ext.tabs.css (1.3 KB, 147ms)
- 5 png files (2.8-2.9 KB each, average 107ms)
Combing the file sizes and their download times (on my home network), you get a total of roughly 94.7 KB taking 838ms.
jQuery UI requires 2 JavaScript files, 1 CSS file and 13 background images (again, with the “smoothness” theme):
- jquery-1.3.2.min.js (55.9 KB, 116ms)
- jquery-ui-1.7.2.min.js (188.1 KB, 221ms)
- 13 png files (22.3 KB total*)
*Something interesting I noticed about the jQuery UI tabs is that my page only seemed to load 5 of the 13 background images, totaling something like 605 bytes and a total of 684ms. Perhaps someone more familiar with jQuery can explain that to me… I didn’t dig deep enough to figure out what was going on, but I’ll base my total on what Firebug says. I’m guessing that I’m not using all of the CSS background images for this theme.
Overall, that brings jQuery UI tabs to a total of roughly 245 KB taking 1021ms.
What Does That Even Mean?
According to my inaccurate, quasi-scientific study it appears that ExtCore requires slightly more code than jQuery UI. On the other hand, ExtCore also appears to be downloaded by my browser more quickly than jQuery UI. In reality, those numbers probably offset each other as the extra markup required by ExtCore increases the HTML file size. The fact that I’m using a theme on jQuery UI probably also has a slight impact on performance.
Which do I prefer?
In essence, both libraries create tabbed widgets from the same basic HTML markup – though the differences are significant enough that they’re not cross-compatible.
Judging both frameworks as they stand in my examples, I will say that I like the conciseness (is that a word?) of jQuery with regards to both HTML markup and JavaScript code. But I also like that ExtCore requires fewer files. As someone who uses the larger ExtJS framework a great deal, I’ll say that I am very likely to choose ExtCore over jQuery UI most days of the week.
Are there any ExtCore or jQuery UI users out there? What do you think?




