jQuery and Interface (now called jQuery UI) save the day! AGAIN!

Currently (Feb 08), I work as a web designer/developer and usability specialist. I built an application several months back that uses many features of jQuery 1.1.2 and most features of interface 1.2 (now called jQuery UI). Thanks to these frameworks the majority of this application is cross-browser and standards compliant. Also, it was developed in a short 2 week time frame which would have been virtually impossible without jQuery and interface. The application shows some great uses for jQuery and interface. It is particually interesting from a UI and usability perspective. You can read more, demo it and download it at the following link…

http://www.hickendesign.com/mark/WorkExamples/StrategicRetreat07/

Enabling Cross-Domain AJAX in Firefox

So I just learned how to do this… what a time saver this will be for AJAX development. Be warned that this allows cross-domain XHR’s to and from any site! This is a major security risk.

1. Close Firefox

2. Edit the file prefs.js in your Firefox user profile folder

3. Add the following line anywhere in the file

user_pref(“capability.policy.default.XMLHttpRequest.open”, “allAccess”);

4. Save the file and re-open Firefox. You can now risk your life and limb by doing XHR’s to whatever domains you want – congratulations!

jquery get() method

Since I learned about jQuery I’ve wondered why it didn’t give you access to the original DOM elements that it selects.  Well, it turns out that it does.  Unfortunately I didn’t find it sooner because it doesn’t work the way you’d expect it to.  The method is get().

You’d expect it to work like this…
var selectedElement = $('#divIdToSelect').get();

Unfortunately that returns undefined.  Instead you must pass the get method an index since the jQuery object is essentially an array.
var selectedElement = $('#divIdToSelect').get(0);

This second method works beautifully!  I’ve been able to get by for the most part with out this method because jQuery is so complete but this really puts the icing on the cake that is jQuery!