Posts Tagged: JavaScript

Be careful with JavaScript variable declarations

Make sure you declare all your JavaScript variables exactly once. Otherwise it’s easy to introduce bugs that are hard to diagnose, especially if you’re used to programming in a C-like language such as Java, C++ or C#. Continue reading “Be careful with JavaScript variable declarations” →

Optimised jQuery Corners plugin

I’ve created an optimised version of Dave Methvin’s excellent jQuery corner plugin. This allows jQuery users to apply all sorts of fancy effects to the corners of web page elements: the now-standard Web 2.0 rounded corners, bevels, dog-ears and many more. The plugin works by injecting extra elements into the page, and I noticed a way to achieve the same effect with fewer elements. This improves the speed and memory usage of the plugin. Continue reading “Optimised jQuery Corners plugin” →

Google Web Toolkit

Google have released the Google Web Toolkit — “Build AJAX apps in the Java language”. At first I thought this might just be their version of the Yahoo UI Library, but it turns out to be a completely different approach to the same problem. The YUI Library (and most other Ajax libraries) allow you to build a Web UI directly, using HTML and JavaScript. With GWT, you write a GUI application in Java, and GWT translates it into JavaScript and HTML for web deployment. It’s a less flexible approach, but could make it easier for Java developers to develop web applications with desktop-style GUIs — if this is what they really want. Continue reading “Google Web Toolkit” →

Ajax: How to do it

Ajax and “Web 2.0” have been getting more and more exposure over the last year or so. It may not be quite the revolution it’s cracked up to be, but behind the hype there are useful techniques for building better applications. When people start asking you what you’re doing with Ajax/Web 2.0, you should have a good answer — so here are some thoughts on what you can do about Ajax. Continue reading “Ajax: How to do it” →

Setting the “name” attribute in Internet Explorer

I have recently needed to write code that uses JavaScript to add elements dynamically to a web page on the client. I read the relevant W3C documents and wrote the code, and it seemed to work fine. Until I tried it on Internet Explorer. After some digging, I found an explanation in the MSDN DHTML reference, on the page describing the NAME Attribute. Continue reading “Setting the “name” attribute in Internet Explorer” →