1.2.1
How to remove content
Thu, 01/10/2008 - 20:27 — sgroverRemoving a page element is very easy, once you have a reference to it. Use the standard methods for getting the reference (jQuery selectors, etc.) then use the .remove() method.
$("#myUnWantedDIV").remove();
This code would remove the referenced element (if found), and everything within the element. Basically, that node is removed from the DOM tree.
You can get a little fancier by using the jQuery manipulation tags. For instance, to remove everything in the parent of the target element, we could do this:
$("#myUnwantedElement").parent().remove();
How to access a database
Mon, 01/07/2008 - 04:35 — sgroverThe inherent JavaScript security restrictions prevent us from accessing files or other resources (outside of web accessible content) directly. This means we cannot access a database directly. There is a way around this though, and that is utilizing Ajax.
Via Ajax we can pass a request to a database with a server side resource, get some results back, and then update our page with those results. The results can be whatever we'd like - full tables, report data, or just what background image the user likes.
There are a number of considerations before undertaking this task.
Datepicker
Mon, 12/31/2007 - 21:14 — sgroverThe UI Datepicker plugin provides a dynamic and handy popup calendar for selecting dates. It is very flexible and can be configured and themed in different ways.
The definitive sample of what can be done with the Datepicker can be found at the official documentation or at the demo site.
How to structure a custom plugin
Fri, 12/28/2007 - 01:27 — sgroverLearning jQuery has an excellent posting on recommended practices when creating a custom plugin. If you are moving beyond a simple plugin, this post is a great guide.
How to slide a page element into place or out of site
Sun, 12/23/2007 - 17:34 — sgroverSliding content down into place is a nice feature that can make an interface entertaining and engaging. But more importantly it can be used to reduce clutter when there is a lot of content to be shown. So it is also important to hide content when it's not in use. But the hiding of the content should complement the showing routine. jQuery provides three simple animation routines for this purpose - the .slideDown(), .slideUp(), and .slideToggle() methods.
The three methods all take the same arguments - a speed, and a callback. Both of these are optional.
