Naneau

Go dik-dik, go!

Category: Javascript

Serving JavaScript and CSS

Now that JavaScript based sites are on the rise again, I have noticed that a lot of people serve their JavaScript and CSS uncompressed. With the discussion about all those nifty JavaScript libraries out there reaching an all time high, the fact that you can easily reduce file size by over two thirds should not [...]

More art!

Well… Okay, its not more, it’s just better. I updated it. Which is what I do. I wrote the original script when I couldn’t sleep a few nights ago. Coding in a sleep-deprived state always gives me interesting results, although they may not always be that useful .
Today I took some time and had [...]

Prototype vs jQuery

One of prototype’s often overlooked functions is Element.addMethods(). Especially in these days of comparison between jQuery and Prototype, it’s important. The basic idea behind jQuery is that you can do a CSS selector query, and apply methods (even chaining them) to the result. Like:
12$(’#element’).after(’I get inserted after #element’);
//insert some html after an element
In prototype, you [...]

Artistic endeavors

I have created what I think is the most useless thing ever. I call it ‘Ajax Art’. Check it out!
When I was young I would always fail art class. I was good at building things, but I’ve never been able to draw. I just can’t do it. My handwriting is near illegible as well. I [...]

Why I still love Prototype

There has been a lot of talk lately about how prototype.js is bad. The discussion usually focuses around the fact that it is rather large (~50 KiB) and modifies some behavior that some people have used in their scripts for years. While some of these discussion have valid points, I still think that they miss [...]

On input validation 2

I posted about it yesterday. I’ve thought about it some more. Wrote some code. And I’m happy! I can validate input without fuss again. Yay. I really did get tired from writing trivial form validation rules into my controllers time and time again. Allow me to demonstrate my new approach.
First, I think about what fields [...]

Charts, again

I like this little project. I like the way it looks and how easy it is to work with. It’s fun to play with, and creating it was a lot easier than I expected it to be. So I enjoy working on it.
As a result I added a few new methods again. This time they [...]

Charting engine update

I have updated my HTML charting engine introduced this post a bit. I now like it even better. It’s small, very web 2.0 while it renders fast. While it of course only supports a single data set with label/value pairs and can only draw bar charts, it’s usability factor is getting higher now. With the [...]

Javascript HTML/CSS Charts

Charts are hot nowadays. There are plenty of implementations for the web 2.0 world out there. Most of them are either written in flash, or use some combination of the canvas tag and SVG for rendering. When I was experimenting with plotkit the other day it occurred to me that all it outputs is [...]

Ext JS Zend Model Viewer

The title for this post is quite descriptive. While working on my post on ExtJS grids it dawned on me that all I was doing was rewriting a model definition in JavaScript , for use with the grid. Writing a JSON reader for my Data Store was just mapping it to model fields. And as [...]

Easy living

The life of a programmer has become easier and easier over the years. High level programming languages, decent development environments and good manuals all help. With the rise of the internet, sharing knowledge has become a lot easier. And because of that, people now share solutions to common problems.
Before I started this blog, a few [...]

Updating Ajax Charts

HTML is a markup language for producing static pages. When trying to present data to your end users that changes over time, that can be a problem. There are different ways to get around that. The whole Ajax hype floats on it.
Charts are a way of presenting information. Because they are images you need some [...]

XHTML and “external-window” links

In the good old days of HTML 4, making a link open in a new window was as easy as putting target=”_blank” inside the a (or A) tag. Apparently, you can’t take yourself serious anymore if you still output HTML 4. XHTML really is the way to go.
XHTML strict doesn’t support the target attribute [...]

Creating an Ext JS grid using the Zend Framework

Web development has become a lot easier with the rise of frameworks and libraries that help you with common tasks. On the server side there’s PEAR, CakePHP, Symfony and the Zend Framework, amongst others. For the client you can choose from YUI, Prototype, Scriptaculous, Ext JS and many, many more. All these libraries and frameworks [...]

JsTable and Ext JS

There are plenty of interesting things you can do with JsTable. Because I had some spare time I wrote up a simple application that uses JsTable to build an Ext JS grid. The result will look something like this:

You can do this for every model you have. It will display all the fields for a [...]

Securing JsTable

After introducing JsTable there were concerns about it’s security. While the javascript itself of course can’t change your models, creating a matching controller that gives unlimited access to your database is probably a bad idea.
So I’m going to show you how to make it (more) secure. First, JsTable can be initialized like this:
123var mP = [...]

Introducing JsTable

I stumbled across Jester a little while ago. Jester is a Javascript library built on top of Prototype for working with Ruby on Rails (RoR) ActiveResource. And it made me think. I am not a RoR man, I may turn into one in the future, but for now I’m quite happy using PHP. Since [...]