The JavaScript Archive

d’bug update — down and dirty with jQuery, part three

Once again I have made an update to the books widget down the sidebar of this blog. The images are now correctly preloading, and the books will not display until all have been appended to the DOM. I loop through and simply change the display properties of the list items. This should be a slight performance boost, even though the initial load time is slightly longer. The height property of the widget is also set after the first result set is displayed, so no flicker occurs when browsing.

As I stated before, you are welcome to use the code as you see fit without attribution. If you want to support my efforts, click through from one of the books to Amazon.com and make a purchase.

d’bug update — down and dirty with jQuery, part two

Previously I posted about an update I made to the books widget down the sidebar of this blog. It was a relatively minor update in order to allow users the ability to browse through a larger selection of programming books. Not satisfied with my beta, I decided to put together a more robust widget, which has previous/next functionality, tooltips, and image preloading. The XML was revamped as well. Continue reading.

d’bug update — down and dirty with jQuery

I recently made an update to d’bug, which finally gave me a good reason to load in the jQuery JavaScript framework. I wanted to share it as example of how much time and effort a client-side framework can save you if you are willing to break a few “rules” (the first of which is a lack of accessibility). Continue reading.

JavaScript shorthand tips and tricks

There is no official ECMAScript or JavaScript language feature called “shorthand”. Developers are responsible for coining the phrase, probably after realizing that terms like Ternary Condition are a bit archaic. The Mozilla Core JavaScript Guide does an excellent job of highlighting many of these shorthand techniques throughout tutorials, but I thought it best to have a definitive list all in one place. If you have others you would like to add, please feel free to comment. Continue reading.

How to choose a JavaScript framework

Efficiencies. Projects live or die by them. A JavaScript framework may not make you a better programmer, but it will make you more efficient. That alone should be reason enough to choose a JavaScript framework, or library if you prefer. Unless you decide to build your own, there are plenty of options available to developers. However, choosing the right framework can be tricky, and weeding through a mess of opinionated fanboys (myself included) is intimidating. Continue reading.

Create a “locked initializer” for your JavaScript namespace

Because JavaScript is class-free, you lose the benefit of executing code in a classical constructor before an object is instantiated (referenced/invoked). Do not misunderstand me — you can actually execute code because all functions are constructors, but not in the traditional OOP sense. For instance, the following is a constructor that executes code when the object is referenced. Continue reading.

Mastering JavaScript — concept and resource guide

There is not a single interpreted language used today that causes more excitement, confusion, disdain, and conflict than JavaScript. The language is so incredibly flexible that it is difficult to separate a developer’s choice of coding style from JavaScript best practices. If you are an absolute beginner (as we all once were), this can be an incredibly frustrating experience. Continue reading.