Archives for the 'Javascript' Category

Dynamically Populating a Select Box Using a Hidden Iframe

Let’s say you have two select boxes, Country and City. The contents of City should reflect that of the selected country. A hidden iframe may be used to do this without having to reload the page.
The concept is to use the onchange event of Country to specify the src of the hidden iframe. Server-side code […]

20 January 2007 | Software engineering, HTML, Javascript | No Comments

Never Forget to RTFM

This week I got reminded of the first rule of CS: RTFM. I wanted to use the HTML input tag with type=”image”. In one page everything was fine but in another I got totally bizarre behaviour. After a few days of distracted head-scratching I opened the HTML 4.01 Specification (W3C Recommendation 24 December 1999). The […]

2 January 2007 | Software engineering, HTML, Javascript | No Comments

Simple Calendar Widget

Anthony Garrett has made available his beautifully written, easily customised, LGPL, zero-price, Javascript, cross-browser Simple Calendar Widget. I’ve hacked it to make it accept and display long month names and I’ve also added a “close” button at the bottom.
Updated: I’ve moved today’s date to the top left and the close button to the top right.

16 November 2006 | Software engineering, Javascript | No Comments

Encode Your URL Parameters

If you wish to query a URL using the HTTP GET method, problems will arise if your parameters contain characters such as ? and &.
The solution is to use encodeURIComponent (client-side Javascript) or Server.URLEncode (ASP) or urlencode (PHP).
There is no need to do any extra work at the server side for Request.QueryString(”…”) or $_GET[”…”].
encodeURIComponent example:
location.href […]

21 October 2006 | Software engineering, HTTP, Javascript, ASP, PHP | No Comments

idea rumah