Skip to content

Archive

Tag: Javascript

I have always admired subway maps for the clarity and elegance with which they are able represent a convoluted public transport system. Now there is a way to expand this concept and create your own maps using a subway map plugin for jQuery written by Nik Kalyani.

This plugin allows you to specify the data for drawing the map, and makes the concept of the subway map entensible to represent anything you would like. In fact, I recently saw one detailing the progression of modern rock music, with the different lines representing different musical genres as a timeline, and major bands representing “stations”.

Sample subway map from Nik's demo

For a detailed tutorial of how to use this plugin, go read the original post by Nik Kalyani on his blog.

Share

Statistics is not exactly the easiest of fields to work with. I am not talking about the “how many hits has my blog had today” type of stats, but rather, the “what is the standard deviation of today’s hits compared to the rest of the month” type of stats.

I studied a course in statistics at university many years ago, and I still shudder at some of the mathematical techniques used.

Well, as a programmer, these days, I would just use a statistics library to do the heavy lifting for me, sparing my brainpower for coding instead.

One such library I have found for JavaScript, jStat, makes inserting statistical data and graphs ridiculously easy, and there are several samples on their website detailing how to use the library.

Being a JavaScript library, this can add a lot to just about any web application.

I can think of many, many uses for this…

Share

With interactive web applications becoming more and more complex, the demand for simpler ways of doing things becomes very attractive.

Let’s take a look at client-server interaction. AJAX has been able to do this for years, and there are many good libraries out there, such as jQuery, which make it very easy to use.

I stumbled on NowJS, which simplifies things dramatically. This library makes it very easy to accomplish realtime client-server communication.

The example they have on their side is for building a chat server, in a ridiculously few lines of code.

The library allows you to set up a server component, which can then interact with the client component, by simply making a function call. The server can call a client function, and the client can call a server function, so updating can happen in any direction.

The nicest thing I can see about the library, is that it is really lightweight, and promises to play nicely with all your other JavaScript libraries.

Share

JavaScript, and web browsers in general have never really made drawing vector graphics easy, although HTML5is beginning to change that.

The problem is that browsers still implement things differently.

Here Raphael steps in. It implements vector graphics in a cross bbrowser and easy manner.

The site also has some good examples on how to use it.

Share

We all know that the Internet is a mess, with different browsers implementing things differently, and generally making the life of web developers everywhere a nightmare.

Inevitably, bugs will get through no matter how hard we test, but we don’t always get the feedback we need to fix these issues.

Jupiter IT has released a service called DamnIT , which you include in your JavaScript code, and then can get detailed error reports emailed to you whenever a user has done something that has caused an error to occur in the script.

I can see this saving the butt of many a web developer out there.

Share

Javascript has a fair bit of functional programming built right into the language itself, but Javascript really comes into its own when you add useful libraries on top of it, such as ExtJS or Prototype.

Underscore.js provides a great library for functional programming support, and is similar to what you would get with something like Prototype.

The difference is that Underscore.js does not extend the existing Javascript object model.

There are some great features, for example, functions to return the maximum or minimum values in a list, various array and object-handling functions, such as flattening a multidimensional array.

Share

Most PHP programmers have to deal with Javascript in some form or another. It is a rare project that solely uses PHP to the exclusion of Javascript.

To help out PHP programmers, and at the same time, add some useful functionality to Javascript, there is a project called php.js.

What this open source project has done, is write a library of functions in Javascript that mirror the functionality available within PHP. This means you get things like md5(), strip_tags(), strtotime().

The project is not trying to create a PHP emulator in Javascript, but rather to provide the functions available in PHP in Javascript, which means a programmer well-versed in PHP will be much more productive in Javascript.

Share