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,
[...]
« Previous Entries Next Entries »
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 [...]
Microsoft has released yet another version (the third, I think) of their timebombed XP/IE6 image for use with their Virtual PC Console. (Why they keep timebombing it is a mystery to me — it’s as if they think one of these days, approximately six months from whenever they release a new version, there won’t be [...]
Two good ones from today:
cygwin/perl: change all references to portfolio.html to portfolio_d.html.
perl -i -p -e ’s/portfolio\.html/portfolio_d.html/g’ *.html
More perl command line goodness here.
vim: on every line that has an element with an id attribute, take the value of that attribute and use it as the argument for a php command.
g/id="\([^"]\+\)"/ s/id="\([^"]\+\)"/value="<?php $io->p(’\1′); ?>" id="\1"/
More on [...]
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 [...]
I was just at the online Apple store to buy an iTunes gift card for my mother (who hopefully will not be reading this blog) — when you arrive from iTunes, it drops you on a page where you can choose from a variety of gift card designs. On this screen, it seems that there [...]
A List Apart had a great article recently on using ‘em’ for CSS font-size declarations, which served as great back-up for some conversations I’d been having among coworkers. (It turns out that people who didn’t have a former life in print don’t necessarily understand what an em is: a self-referential unit of font size measurement, [...]
Forgot about coming across DateJS in one of my feeds the other day. Haven’t used it yet, but expect I will next time I have to do much of anything with user date input. I’ll be especially happy if it does end up getting integrated with the jQuery UI datepicker ….
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 [...]