PHP/MySQL-driven development, Windows 7, JavaScript
Posts tagged jQuery
jQuery Tablesorter helper function for WordPress
Nov 3rd
In one of my projects, I converted WordPress into a reporting engine, which is used at 20 car dealerships to track Internet sales. During development, I found that I was writing the same code over and over again for the jQuery Tablesorter plugin, which allows you to sort tables using a simple JavaScript call.
First, I would have to queue the script file, then add the appropriate JavaScript. To ensure the JavaScript was executed at the right time, I had to create a function to use it with add_action(). I found this to be tedious and unnecessary, and wrote a simple helper function to remedy this. The following function was added to /wp-admin/includes/template.php, but if you use it, it will most likely go in a plugin or theme include. This will prevent it from being overwritten during WordPress upgrades. Read the rest of this entry »
Simple handling of jQuery dependencies with Zend Framework 1.9.x
Sep 25th
I have a lot of experience with WordPress development, and I’ve grown to love the way JavaScript dependencies are handled in that particular application. In WordPress, all JavaScript dependencies are defined in /wp-includes/script-loader.php. To ensure jQuery loads before any jQuery-dependent scripts, you just use $script->add() and reference the jQuery library ID. Easy as pie. Read the rest of this entry »