//JavaScript

Opening PDFs in a New Window with JavaScript

2010-05-25T22:43:27+00:00 January 23rd, 2008|JavaScript|

Opening documents such as PDFs in a new window should be automated using JavaScript for the following reasons. Users will often close the web browser when a PDF is opened, mistakenly believing the document has been opened in Adobe Reader, the attribute historically used to open a new window, target, has been removed from the HTML 4.01 Strict specification (it's now deprecated), opening a new window is a behaviour and should be moved to the behavioural layer.

Striped Tables Using JavaScript

2010-05-25T22:42:29+00:00 January 23rd, 2008|JavaScript|

JavaScript can be incredibly useful when you need to automate repetitive tasks. In this article we'll implement a simple JavaScript function that will apply alternate striped rows to a table. We'll implement this technique using unobtrusive JavaScript.

Floating Point Comparisons In PHP and Javascript

2010-05-25T22:45:59+00:00 January 8th, 2008|JavaScript, PHP|

Here’s the problem. Say you’re comparing two floating point numbers a (71.00) and b (71.00) to see if they are the same. The problem is if you’ve done any calculations to arrive at these numbers they might actually be stored as 71.00000000001. Now if one of them is stored that way and the other isn’t and you compare the two to see if they are equal you’ll get a FALSE as the response, even though they should be the same.

Essential Javascript — A Javascript Tutorial

2010-05-25T22:49:11+00:00 December 2nd, 2007|JavaScript|

Javascript is an interpreted language with a C like syntax. While many people brush the language off as nothing more than a browser scripting language, it actually supports many advanced concepts such as object-oriented-programing, recursion, lambda, and closures. It's a very approachable language for the beginner that quickly scales to be as powerful a tool as your skills allow.

A Designer’s Guide to Prototyping Ajax

2010-05-25T22:49:25+00:00 November 23rd, 2007|JavaScript|

Jeffery Zeldman wrote earlier this year in his essay about Web 3.0 that “Wireframing AJAX is a bitch.” And while I can’t deny the statement, I do think there are steps we can take to alleviate the pain. The problem is static XHTML/CSS wireframes are woefully inefficient at the task of communicating and documenting the features available to the new crop of Ajax web sites. Because we’ve been working on a rather intense Ajax project for the last few months, we’ve been developing and refining a number of techniques and guidelines to help our team design for Ajax by moving beyond the traditional forms of functional specs and wireframes to something a bit more appropriate for the dynamic medium—rapid prototyping.

How to Setup a Randomising Function

2010-05-25T22:52:00+00:00 November 17th, 2007|JavaScript|

A couple of sections on arbitrary constant used to utilise JavaScript in order to generate some random content for that pesky right column. This was done for two reasons: 1) to give the site a bit more depth and 2) to help me learn the basics of JavaScript. Now that both of these goals have been achieved, here is a guide detailing how it is done, which will hopefully prove useful to anyone new to this sort of thing.

Introduction to JavaScript Tutorial

2010-05-25T22:52:44+00:00 November 9th, 2007|JavaScript|

Javascript, despite the name, is not part of the Java programming language developed by Sun. It was originally introduced with Netscape Navigator v2.0 and was designed to create dynamic online pages, such as checking details on html forms before allowing the page to submit the data.

A Simple Image/Link Rollover in Javascript

2010-05-25T22:54:08+00:00 October 31st, 2007|JavaScript|

Your web site has been up and running for some time and while you are pleased with the results, you can't help but think that it needs a little bit more "something". Maybe you want to do something with the links, like add some pictures or a "rollover effect". Well, maybe not all the links; just one or two. There's a fine line between classy and gaudy.

Javascript Diff Algorithm

2010-05-25T22:57:51+00:00 August 22nd, 2006|JavaScript|

This method takes two strings and calculates the differences in each. The final result is the 'newFile' marked up with HTML (to signify both deletions from the oldFile and additions to the newFile).