« Previous Entries
Javascript | Jun 12, 2008
6 comments

Sending Javascript Functions Over JSON

In this post I’ll present a way to send javascript functions over JSON from a php server (but it should work on other platforms too). Since PHP version 5.20 PHP includes the functions json_encode() and json_decode(). These functions encode values into JSON formatting and decode JSON formatted strings into associative arrays. The json_encode() function is not able to encode a value into a (javascript) function. This is a common issue when configuring graphs from Flotr (my Javascript plotting library) with JSON data. Here are my findings.

read this article

Javascript | Dec 11, 2007
3 comments

GChart 0.2 alpha released

Today I released GChart 0.2 alpha.

GChart is a small piece of javascript (packed 2.4kb) that enables using the Google Chart API in an easy way. GChart translates passed options to a url that can be used to request a chart from the Google Chart API. Also it provides several ways to insert, apply or return the chart based on the passed options.

It implements almost all parameters the Google Chart API accepts. You can read more about it on the GChart Project Page. For a quick download, go here, and if you just want to see the GChart source, go here.

read this article

Javascript | Dec 7, 2007
2 comments

Google Chart API JS Wrapper: GChart

As soon as I read about the Google Chart API I started writing a javascript wrapper for it (I called it GChart). It’s not finished yet, but it has most functionality. The simple, text and extended encoding types are supported, as wel as datasets, size, legends, titles and different types of charts. GChart 0.1 alpha is now available for download.

read this article

Javascript | Oct 29, 2007
3 comments

Javascript left-hand assignment

Wouldn’t it be great to do something like this in javascript:

function test(){
	return ['first!', 'second!'];
}

[first, second] = test();

alert(first); // should say 'first!'
alert(second); // should say 'second!'

read this article

Javascript | Aug 21, 2007
11 comments

Three handy javascript techniques

In this post I’ll share three might-come-in-handy javascript techniques I often use. These techniques are: using the javascript ‘with’ keyword, using the ‘String.indexOf’ function to shorten if conditions, and using the ‘arguments’ array to get a better understanding of how (undocumented) functions work.

read this article

Javascript | Jun 21, 2007
1 comment

Detecting Gears and Dojo Offline

I was wondering if I could sniff whether or not a visitor has the Dojo Offline Toolkit or Google Gears installed. So I took a dive in their code and I came up with the following.

read this article

Javascript | May 2, 2007
1 comment

Sorting javascript arrays

Well, it’s been a while since my last post. I couldn’t find any interesting subjects to write about. Anyway, today I’ll write about sorting arrays. I’ll start with sorting arrays numerically and alphabetically, to introduce you some basic techniques.

read this article

Javascript | Apr 6, 2007
1 comment

Troubleshooting Javascript

Lately I got a lot of questions (comments/emails) from people who have problems with getting their javascripts working. I really enjoy it when I can help other people with such things, but I’m a very busy man. So this article’ll be about getting help from javascript specialists.

read this article

Javascript | Mar 20, 2007
1 comment

HistMan v0.2: Port to Prototype

Just a day after the launch of HistMan I’m releasing v0.2. I’ve also ported this version to Prototype, so now Mootools and Prototype are supported.

read this article

Javascript | Mar 19, 2007
4 comments

HistMan: Javascript History Manager

HistMan is a script that let’s you manage browser history (back/forward buttons) and bookmarking in Ajax applications using Mootools. My aim is to deliver a small and efficient framework that’s easily ported to frameworks other than Mootools.

read this article

« Previous Entries