How to add a calendar (date picker) to your web applications
For almost any webapp, it's critical to be able to enter dates. But how do you ensure that people enter them in the right format? How do you make it look good? The easiest answer to both of these questions is to use a calendar object of some sort. This not only can look great and restrict user input, but at the same time it...
How to rotate an image or text with JavaScript & DHTML
So I need to rotate an image every few seconds on a homepage of a site I'm building. I looked around for some pre-built code that I could do this with, and I found a few functions. I picked the one I like the best, and I've modified it to my needs. This JavaScript code lets you define an array of HTML items (so you...
How to set an iframe to 100% height in FireFox
Here's the HTML code to implement if you'd like to embed another web page in an iframe on your web site, but would like it to appear as the entire page. This makes it hard to detect that the page is within an iframe. It's easy to do in IE, just set the iframe height and width to 100%. But this is invalid markup and...
How to embed a .wmv file in a webpage
Ever wanted to have a .wmv file play automatically when a user visits your website? This is how you'd do it. Each embedded player instance on your Web page needs the object definition to clarify which version of the Windows Media Player will be called. This is identified by both the CLSID reference and the CODEBASE definition. Here's the code to embed a Windows Media...
How to load XML data with JavaScript (AJAX tutorial)
The latest technology (or grouping of technologies) sweeping the web is AJAX (Asynchronous JavaScript And XML). This technology, using the XMLHttpRequest() object to retrieve a piece of XML in the background, and load its contents into the web page dynamically, thus creating a constantly refreshed Dynamic HTML (DHTML) interface. You can make very complication AJAX code, but this is the bare-bones code to simply grab...