Archive | JavaScript RSS feed for this section

Link: Moment.js

Moment.js is a lightweight javascript library for working with dates -
manipulating them, parsing them and outputting them into a human-readable
format. And it even does languages, too!

Link: The DOM Monster

The DOM Monster!

I’m always on the look out for new yardsticks to measure by code by, and here’s another one that I’ve been introduced to recently. It’s called the DOM Monster, and it’s something that you can drag and drop into your browser bookmarks bar, and then later click on to evaluate the current HTML page, based on things like its content, complexity, nesting levels and general content optimization.

The monster gives you a report and a summary of what it’s found, and it’s generally a pretty good summary of best practices for your HTML and JavaScript construction, even if it’s not linking you specifically to the original rules that govern this sort of thing.  All of which will improve your pages’ rendering speed, performance on older machines, and performance on mobile devices, which is what a lot of people care about nowadays.

Link: jQSlickWrap

We’ve known for quite a while that jQuery is brilliantly clever, but holy cow, the code behind this is pretty damn clever.

jQSlickWrap

What jQSlickWrap does is automagically work out the shape of the image by extracting the background colour, and then modifies the HTML to wrap the text perfectly around the image.  Obviously something so awesome won’t work on some browsers, but it’s designed to cleverly degrade to whatever your browser can manage, which is pretty fantastic.

Read more about this over at the jQSlickWrap site: http://jwf.us/projects/jQSlickWrap/

Link: Try out jQuery selectors

It doesn’t look like much, but this website is great for illustrating how the selectors in jQuery work.

http://codylindley.com/jqueryselectors/

Targeting multiple browsers with CSS… and some Javascript trickery.

There’s a clever little javascript library that allows you to write CSS specifically for Chrome, the iPhone, IE 8, etc. all in a single file.  What it does is manipulate the HTML document client-side to add additional classes to the page, based on your browser type.  The end result is that your page gets additional selectors like .ie or .gecko added – and you can setup a single CSS file to target all of these browsers in one shot – no server side magic or conditional comments in the HTML.

You can find more information here ( http://snipplr.com/view/9340/css-browser-selector/ ) or download it from here (http://github.com/rafaelp/css_browser_selector ).