jQuery: Build table from JSON data
Given data like:
var data = {
“GUEST” : {
“visits” : 1734070,
“visits_pct” : 74,
“users” : 1,
“net_pv” : 3432781,
“users_pct” : 0,
[…]
Given data like:
var data = {
“GUEST” : {
“visits” : 1734070,
“visits_pct” : 74,
“users” : 1,
“net_pv” : 3432781,
“users_pct” : 0,
[…]
I’m working on a new template for a client, and they asked me to display some list elements in a random order on each page load. I did my Google due diligence, but didn’t come up with anything that wasn’t slideshow-like — what I wanted was just something that would show all of the children […]
Ever wish you could use jQuery on a page at the drop of a hat, without having access to the page itself? Well I’ll be damned, you can.
(This is one of those things that in hindsight seems so painfully obvious that I’m almost embarrassed to admit that it never occurred to me, but admit it […]
Following up on my 13 seconds of selection hell:
jQuery: what are the fastest selectors?
Turns out that, as you might expect, $(’div.class’) is faster than $(’.class’), and so is $(’div’).filter(’.class’). Knowing where not to look (”skip anything that’s not a div”) helps make jQuery faster. To which you might say, “well duh.” Regardless, the post above […]
I just came across this post in my Google Blog Search jQuery feed. It’s a quick story of how a developer convinced a corporation to use jQuery for an application, and it caught my eye because I was in a similar boat a few months ago.
A colleague had come up with a concept for […]
Before:
// select all elements with an id or name attribute of fieldName;
// some are inputs (name attribute), some are td’s (id attribute)
var $field = $(’#’ + fieldName + ‘, [name=’ + fieldName + ‘]’);
After:
// give inputs both a name and an id attribute,
// and then just select fields and td’s via id
var $field = $(’#’ […]
Update: I’ve since written a anchor-based URL navigation plugin that attempts to capture what’s described below.
–
I’m working on an application that has several panels of content, each accessed by clicking on a link in the page’s main navigation. I wanted to give users the ability to get back to a panel after they’d left […]
I’m working on a web-based ROI calculator where the user enters some data, the data gets passed to the server via an XHR, numbers get crunched, and a JSON string with updated values gets returned. There are a lot of fields on the screen at a given time, so I wanted the user to get […]
I love trac, and I’ve been doing lots of work lately to customize it so our clients can use it to send us requests. With the configurable workflow option offered in version 0.11, it became the perfect way for us to manage and track client requests. By connecting it to the subversion repository we use […]
When I recently got to choose a javascript library for our team of designers and front-end developers to standardize on, learn and use, I skipped over other libraries I had some experience with and went with one I’d never used before: jQuery. Here’s why:
It’s small but complete. Simple effects, utility functions, AJAX, CSS 3 […]