Posted in 'JavaScript' by James on November 17th, 2008
I thought it would be fun to do something like this a while ago but never bothered. I had a bit of spare time today so I made myself a little random word generator. Here it is:
function createRandomWord(length) {
var consonants = 'bcdfghjklmnpqrstvwxyz',
vowels = 'aeiou',
rand = function(limit) {
return Math.floor(Math.random()*limit);
},
i, word='', length = parseInt(length,10),
consonants = consonants.split(''),
vowels = vowels.split('');
for (i=0;i<length/2;i++) {
var randConsonant = consonants[rand(consonants.length)],
randVowel = vowels[rand(vowels.length)];
word += (i===0) ? randConsonant.toUpperCase() : randConsonant;
word += i*2<length-1 ? randVowel : '';
}
return word;
}
alert( createRandomWord(10) );
It will alternate between consonants and vowels until it meets the specified length and then it will return a random word.
E.g.
- Fanewera
- Wifuwehi
- Feranuro
- Ponosive
- Boviredo
- Ravipare
- Nujaruki
They’re kinda silly but actually a couple of them might make good company names, actually "Boviredo" sounds a bit like an Italian pasta dish!
See a demo of it here: demo/random-word
Anyway, it was just a bit of fun, nothing serious! Please note that it doesn’t create real words, just random combinations of letters, obviously it could create a real word (since it’s random) but don’t expect it to.
Posted in 'JavaScript' by James on November 6th, 2008
Recently, I created a brand new jQuery plugin which I wrote about on my other blog. When I release something new I like to dress it up a bit so I created a plugin page just featuring this new creation. I decided to add a couple of little enhancements to help users when viewing this page.
Tabbed Content
I needed to create a tabbed-content feature so that users would find it easier to navigate through the demos, this is how I did it: (No bloated plugins needed)
Posted in 'JavaScript, Usability' by James on October 31st, 2008
Having used jQuery on a number of projects I’ve picked up a few handy shortcuts that are definitely worth sharing. There are no secrets here, just basic jQuery techniques discovered with the aid of the jQuery documentation. If you have any which you think are worth mentioning then please feel free to leave a comment.
Checking if the DOM is ready
Running code when the DOM is loaded and ready for manipulation is a popular requirement. The ideal solution is to place all initiating code at the bottom of your document (as per Yahoo’s "Best Practices for Speeding Up Your Web Site") but sometimes this is not possible. The next best alternative is to use a solid ‘DOM ready’ function such as the one jQuery offers. You normally access it like this:
$(document).ready(function(){...});
There’s a quicker way of accessing the same functionality:
Creating elements
There are a few different ways of creating elements, this is my favorite:
$('<div/>').appendTo('body');
Alternatively you could take this route:
$('body').append('<div/>');
Notice that you don’t have to write out the entire element. Even though DIV elements cannot have self-closing tags it’s still fine to specify it like above - JQuery will know what you mean.
Posted in 'JavaScript, Twitter' by James on October 25th, 2008
I’m one of the few people on this planet still using the Twitter web interface. I just cannot be bothered with any of those Adobe Air clients, they seem too intrusive. Twitter isn’t so great that it deserves it’s own process in Windows (sorry Twitter!). Plus, if I was using a client I’d feel like I’d have to tweet about every tiny insignificant thing that happens, which, although it is the point in twitter, would be a massive waste of time!
There are a few things which annoy me about the web interface though. The worst thing by far is that it’s very slow and sometimes just doesn’t work. There are also some posting issues; if I have a really long link which I want to share, it won’t let me press the "update" button (because my tweet is now over 140 characters) - but I know that Twitter will convert the URL to a tinyurl which will surely result in a tweet shorter than 140 characters but Twitter still insists on disallowing this action!

I got really tired of this, twitter wouldn’t let me tweet even though shortened versions of posted URLs would fit into the 140 character limit quite nicely! Out of desperation I decided to create a cool little GreaseMonkey script which solves this problem.
You can install the script here - (Sorry, it’s Firefox only, duh!)
Posted in 'JavaScript, Usability' by James on October 18th, 2008
JavaScript libraries like MooTools, jQuery, Dojo and Prototype have proven very popular with developers recently, perhaps too popular!?
Over the last year there’s been a major recognition boost for these libraries, especially those featuring animations/effects and Ajax capabilities. Blinking/fading/sliding text was in fashion back in the nineties but it seems, following the hype of Web 2.0, these effects have made a massive comeback!
To be honest I think it’s great; what better way to expand the imagination of the average developer than to give him/her some brand new toy to play with? Web developers are now thinking of innovative ways to utilise these new-found JavaScript enhancements and designers are pushing boundaries with their designs, integrating these enhancements into their mockups!
This is all wonderful, but unfortunately I fear the overuse of JavaScript libraries such as jQuery has had a detrimental effect on usability. Obviously we had issues before these libraries and we will surely continue to rave about it afterwards but I cannot help but notice what is happening right now; people are turning a blind eye to usability and focusing all their attention on making their websites as smooth and swish as possible!
Posted in 'General, My Life' by James on October 14th, 2008
We tend to throw around the word "poverty" a lot nowadays but do any of us really bother to think about it? I mean, do any of us think about its effect on the world and on us as humans? I for one, don’t! I mean to be totally honest, I very rarely think about the one billion or so people living in absolute poverty around the world!
Not to place too huge a blame on western society but its probably western culture and education that has left me and others so apparently callous and uncaring. Yes, schools teach you about poverty and how massive a problem it is but you don’t hear any teachers or the government telling us go help, no, of course not! This would not benefit the economy!
But then, is this massive issue of poverty something which can be solved with a few extra helping hands? I really doubt it!
Almost one half of the world’s population live under two dollars each day - what an absolutely pitiful amount! How did we, as a species, let it get so bad? Surely evolution is not just about survival of the fittest, surely there is some instinctive drive to help others! If there is then how on earth did we let it get so bad? What happened!?
Maybe we should all pass the blame on to ignorant generations of the past and then forget about it, or maybe it is, in fact, the governments fault (isn’t everything!?)… Maybe every single person on the planet is to blame, even the ones living in poverty! I don’t’ know!
Posted in 'General, News' by James on October 12th, 2008
Recently, I’ve been working on a URL-shortening service similar to tinyurl.com. It’s called Reque.st and features a sweet-looking homepage, some Ajax’y goodness and a "custom pointer" option.
Using it is incredibly simple. All you need to do is enter the long url which you want to shorten and hit "shorten" - you also have the option of specifying a "pointer" which can be related to the URL. For example if I have a long URL linking to a PDF report:
http://very-very-long-url.com/pdfsection/pdf/2008/01/01/pdf/newer/
?specify=129483&isThisVeryLong=true&borderOfTyping=yep#ImportantPartOfThePDF
I could shorten it and add a custom pointer of "my-pdf-report" so to get to the above URL you would go to:
http://reque.st/my-pdf-report
Useful, huh!?
Posted in 'General, News, Twitter' by James on October 7th, 2008
Dani McDaniel of ‘Anidan Design‘ and Adelle Charles of ‘Fuel your Creativity‘ recently launched ‘Just Tweet it’ (JustTweetIt.com), a site which offers twitter users the opportunity to submit themselves to a global directory of fellow tweeters. The directory is split up into various subdirectories sorted by interests & professions. Obviously I’ve put myself in with the ‘web developers’!
From the site:
Just Tweet It was created to make it easier for people using the popular micro-blogging service Twitter to find other “Tweeters” with similar interests.
For news and updates on the new site make sure you follow @justtweetit on Twitter.
A superb idea from Adelle and Dani and congrats to them on the successful launch!
Posted in 'General, My Life' by James on October 5th, 2008
Having left school in June I needed a job to make some money over the summer. I was going to settle for something tedious and in-my-view boring like waiting tables at the local restaurant or working at the nearby supermarket, but instead I decided to go further and look for a job which I would actually enjoy.
I’d already been designing websites (mostly personal projects) for about two years, and I’d earned quite a bit off freelancing, so it made sense, since I had the skill set, to look for jobs in the web development/design industry.
Searching online for "web design" jobs yielded rubbish results. Most of the jobs listed were freelance focused or not based in the UK. I would have been happy to adopt a couple of freelance jobs but nothing is more valuable than real industry experience, and that meant getting employed properly for the summer.
After even more searching I eventually came across NMA’s "top 100 interactive agencies". I started at the top of the list, visiting each agency’s website, having a look at their client list, and seeing where they were based. I ended up picking eight agencies, all based in London. I wasn’t looking for "vacancies" because I knew I would be unsuitable for any official listed job. Since I was only looking for an internship to get me through the summer I figured it would be best to simply send some emails explaining this amd hope for the best.
After writing my CV and emailing the applications nothing much happened. Obviously I had to give it a bit of time, so I did…