Archive for the ‘Javascript’ Category

An updated version of my CV can be found at

I am a Java developer and TeamSite & LiveSite J2EE CMS specialist. I rely on around 15 years IT industry experience to deliver projects and functionality that make your applications and websites engage with your customers.

I have successfully held contract positions at several leading IT consultancy firm on large implementations for: a large Spanish Media group, a leading mobile phone manufacturer’s global website and a leading investment bank in the city of London.

I used to teach all Autonomy/Interwoven TeamSite and LiveSite courses for 2 years when working at Interwoven and I am maintaining a blog about their products now. I have been a project manager and web application developer in the IT industry for large scale Web Content Management Systems for several years. I am always looking for new and exciting opportunities.



Using other types of variables to create new values inside a script variable can be achieved through the use of :

  • $IW_CV(myconfigurablevar), or
  • $IW_DS(mydatasourcevar), or
  • $IW_SCRIPT(myscriptvar)

I had to fix the overlay positioning, or more to the point, make sure that the dimmer behind the overlay stretched over the whole document. To do that, I had to do the following:

function getDocumentHeight(){
 if (document.documentElement && document.documentElement.scrollHeight && document.body && document.body.scrollHeight){
 if (document.documentElement && document.documentElement.scrollHeight ){
 if (document.body && document.body.scrollHeight){
function getDocumentWidth(){
 if (document.documentElement && document.documentElement.scrollWidth && document.body && document.body.scrollWidth){
 if (document.documentElement && document.documentElement.scrollWidth ){
 if (document.body && document.body.scrollWidth){

This works in IE6, IE7, Opera, Chrome, Firefox.

It’s so annoying. I had a for look in a javascript and it was blocking on the “<” sign of my for loop, causing an error. Here’s the fix:

<xsl:template match="/">
 <script type="text/javascript" language="javascript"><xsl:text disable-output-escaping="yes"><![CDATA[
   for (var i=0; i < someArray.length; i++){

I was looking for something entirely different and found this blog about interviewers asking questions at interviews and why they are good questions.

I decided to answer them to find out how I would fare in the modern day interview.

What industry sites and blogs do you read regularly?

six revisions is the best place to keep my design skills accurate. Since I am mostly a developer and not a designer, I need to work at it. So I read that, although whatever development they have there is mostly front-end. With back-end development, the blogs are a little more involved and I am struggling to find the time to read them and I’ve not really found any that talk about Autonomy/Interwoven products in as much detail as I do. (by the way, I’d be happy to be proven wrong).

Do you prefer to work alone or on a team?

It varies depending on the complexity of the project and the complexity of the task at hand. the size of the projeccts I work on tend to be quite big, so collaboration is essential. However, we are mostly thinkers and in order to be effective, you need a place to think. I do work better in quiet environments.

How comfortable are you with writing HTML entirely by hand? (+exercise)

When I started, there wasn’t many WYSIWYG editors that could do the job so I had no choice. I still code HTML by hand today.
The editor I use (beloved Netbeans) has syntax highlighting and code completion on HTML so it goes quite fast.

What is the w3c?

World Wide Web consortium. They help define the standards of the web and their best task is to prevent Microsoft from messing things up too much and going off in a tangeant.

Can you write table-less XHTML?  Do you validate your code?

I do write table-less XHTML and CSS, although I tend to work with designers a lot so I usually have them verify the CSS. My code always validates if I can help it.

What are a few of your favorite development tools and why?

My favorite development tool is Netbeans. With it, I can do Java, HTML, CSS, javascript, XML and XSL. For mee it’s very complete. Put a layer of Firefox on top with a few choice add-ons like Firebug and HTML validator and you have a complete set-up. I also use my blog a lot, as I use it as a knowledge repository.

Describe/demonstrate your level of competence in a *nix shell environment

(the original question asked how to recursively copy directories and how to make a file only readable by the owner).
cp -R somedir, chmod 500 somefile

What skills and technologies are you the most interested in improving upon or learning?

For me, the back-end Java is just as satisfying as the front-end javascript. I am a developer at heart. The web services layer for me still holds a few secrets I’d like to unlock. I think this is the final layer I need before I’d start confortably call myself a J2EE web architect.

Show me your portfolio!

I have worked on intranets and Internet sites so not all of it can be accessed externally. Here are the few that still are in existance.,,

What sized websites have you worked on in the past?

The biggest was the Environment Agency. It was big with all its metrics: number of pages, number of editors, number of visitors. the Environment Agency is responsible for flood warnings and that was always a high profile project within the  programme of work. When the UK is hit by a series of floods, The website is hit by a deluge of requests. We had to put in place a fail-over static webserver to take over when the dynamic servers would not cope anymore and use caching… a lot of it.

Atkins intranet was big. They had everything on it and as soon as you need anything, all 15000 employees could need anything from blueprints to communications setting, they found it there. The pressure came as the system grew out of proportion and we had to do something about it. We upgraded everything: software and hardware.

Nomura’s intranet site is also quite popular within. Every department has an intranet site, from Operations to Facilities management via Equities. The support function is quite intense there as the department staff are updating their sites themselves, and not all are fully web savy.

Show me your code!

I am not afraid of putting my words where my mouth is. ask me what you want to achieve and I’d develop it for you. For some code samples, there are plenty on my blog.

What are a few sites you admire and why? (from a webdev perspective)
I am a guy without bling. This transfers in my online tastes. I go to sites because they do what they say they do, not because they look good.
Linkedin is very useful and feedshow is very handy. Google maps is always reliable. functionaly over form. Always.

Fix this code, please.

(the original question prompts the interviewer to show broken code).
Yes, I can do that too.

I just pulled up the website you built and the browser is displaying a blank page.  Walk me through the steps you’d take to troubleshoot the problem.

these would by my methods for solving the problem

Press F5
Press Control+F5
view source. Is the response empty? is the HTML invalid? is the CSS valid?
is any other page displaying similar symptoms?
what is the HTTP response code? 200? other? telnet to the server on port 80 and issue an HTTP request manually. use Fiddler to see more.

What’s your favorite development language and why?  What other features (if any) do you wish you could add to this language?
Java has been hard to learn, because I am a perfectionist. I want to know how to do things, but I want to understand how they work. RMI was very painful that way.
But now I know it, I couldn’t go back to programming in Perl easily.
I think one thing Java could borrow from Javascript is how to add methods to objects like you can assign variables for example. I have found that very useful when doing callbacks in Javascript for example. I am sure this could change a couple of things.

Do you find any particular languages or technologies intimidating?

If I had limitless time resources, none – but that’s not how it works. I focus on the things I need for work and try to learn them before I need them but that’s not always possible. Microsoft technologies are intimidating, not because they’re hard but because you put code in and you don’t know what’s going to come out.

Acronym time (oh boy!)

I don’t like this questions. Acronyms are not your friend. the reason I am saying this is because two different sectors of technology could use the same acronym for different things. Jargon needs to be understood to be effective. the purpose of communication is to understand and be unsertood. Coding things for the sake of coding things is not a clever thing to do, unless both parties have a common understanding. The whole industry suffers of jargon overdose as a whole: ECM, WCM, DM. And yes, I do know what HTML, XML and CSS stand for.

What web browser do you use?

I prefer firefox. whenever I need to develop new stuff, I normally try it out there first. IE comes second. Usually, this is sufficient to ensure it works every where. Then there is IE6. I stopped supporting it for anything personal that I do. Only in the heavy corporate world is it still used, and only there I support it.

Rank your interest in these development tasks from 1 to 5 (1 being not interested at all, 5 being extremely interested)

Java 5, HTML 3, XSL 5, XML 5, CSS 2, javascript 5, content 1, documentation 3, project management 3

What are a few personal web projects you’ve got going on?

I am creating the website for the new side venture I am starting for Wedding Photography. It is quite a good project as it brought with it a lot of new stuff about image manipulation. It uses a custom tag library that I wrote to do XSL transformation of XML documents in the same way that Interwoven LivveSite does. I uses XML to store photo galleries, transforms them using XSL to create the online galleries. It also uses AJAX to dynamically provide slideshow of the whole gallery without compromising initial load times. The site is not live yet and won’t be for a little while as holding a day job, getting married and moving house doesn’t leave much spare time.