Using JUnit to test JavaScript

In this article I am going to show you how you can unit test your JavaScript files using nothing but JUnit. Given the following files: index.html <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Index</title> < »

Universal Game Server with Socket.IO

In this example I will show how web clients can signal to each other using Socket.IO in both the browser, and on the server. The messages can be JavaScript objects, and can be triggered by any event you choose. Messages from other clients will be received in callback functions, »

What is JSON?

The abbreviation JSON stands for JavaScript Object Notation. It describes a way to format data that can be stored in files, or sent over the Internet. The format is almost exactly the same as the syntax for defining an object literally in JavaScript, but with a few exceptions: You cannot »

Parameterized JavaScript

Wouldn't it be nice if you could pass parameters to your JavaScript file? Well, it turns out you can. I have tested the method described here in Chrome, FireFox, InternetExplorer, and Safari. index.html <!DOCTYPE html> <html> <head> <title>Arguments Demo< »

Tomcat ServletFilter to reject request based on query parameter

This is useful if you have a web application developed by someone else. You want to restrict certain features, but you do not have access to the source code. In this article I am giving the source code for a ServletFilter to reject all requests containing a specific query parameter »