Stubblog


IE can’t set name attribute dynamically.
May 1, 2008, 12:00 pm
Filed under: firefox, ie, javascript

I keep tripping myself up with this one, IE is unable to set the name attribute for any dynamically created DOM nodes. It doesn’t matter if you clone an existing node, or create a new one, IE won’t set the name attribute.

Have a look at this example:

var newCheckbox = document.createElement('input');
newCheckbox.setAttribute(’type’, ‘checkbox’);
newCheckbox.setAttribute(’name’, x[i].name);
newCheckbox.setAttribute(’value’, ‘0′);
newCheckbox.setAttribute(’checked’, ‘checked’);

x[i].parentNode.appendChild(newCheckbox);

Will result in a new input element with no name attribute. The only way I’ve found to counter this, that works in both IE & Firefox is to use innerHTML.

var newCheckbox = document.createElement("span");
newCheckbox.innerHTML =”[input name='" + x[i].name + “‘ type=’checkbox’ value=’0′ checked=’checked’]”;
x[i].parentNode.appendChild(newCheckbox);

Is there a better way? I’d be interested to hear about any other solutions that might work.

-S



Manchester United Vs Chelsea … I wont be watching the Champions League final.
May 1, 2008, 11:04 am
Filed under: Champions League, Chelsea, Manchester United, football

So this years Champions League final is between Chelsea & Manchester United and I couldn’t think of a worse advert for British football than this. It’s a repeat of last years rubbish display of football that was the FA Cup final, one of the dullest games I’ve ever watched.

Chelsea always play not to concede a goal and score on the break, and if the tactics deployed by Manchester United against Chelsea the other week are anything to go by, so will they. Hopefully they will have learned a lesson and not repeat that.

I’m not a fan of any of the teams involved in the semis, but I think a Liverpool - Manchester final would have been a much better advert for football in this country. At least the 2 sides would set out to play attacking football. You just have to look at the top scorers table and Liverpool have 4 players, a total of 22 goals between them.



It’s almost like Nintendo wants to fail.
April 30, 2008, 9:31 am
Filed under: Uncategorized

I’m starting to think that Nintendo wants it’s Wii console to fail, even before it was launched they took a massive gamble not to significantly upgrade the hardware of the machine from their previous platform, the Gamecube, and invest instead in a novel controller. This gamble however paid off and the Wii now has a massive install base. The challenge Nintendo now has is to keep those people interested in their platform, keep them feeding the quarters as they used to say.

The modern day equivelent to feeding an arcade machine 10p’s all day is downloadable content, be it in the form of Rock Band’s downloadable songs, XBos Live’s Live Arcade or extra missions for games like Grand Theft Auto. So far the Wii has been really dissapointing as far as online gaming is concerned. Wikipedia has a list of all the games that support WiiConnect24, but I don’t count sharing scores as online play, and many of them are not available outside of Japan.

The latest game to shun dlc & online play is Rock Band, but here in the UK at least it seems they’re going to try and recoup that lost income by massivly over charging for the game itself in the first place. Even at Game’s discounted prices, it’s still twice the price American gamers pay.

Apart from the cost of the game, I’m not being too harsh on Harmonix/EA here because I feel the problem is the platform’s, with it’s feeble amount of storage and complete mess of a friend system that requires each player to know 2 - 12 digit numbers for every other player in the game in order to be able to play against each other.



It’s a good time for Geeks to watch TV
April 3, 2008, 12:42 pm
Filed under: TV | Tags: , ,

For those of us who still watch TV in the more traditional way, these shows all start with new series this weekend:

  • My Name Is Earl
  • Dr Who
  • Battlestar Galactica

I’m still a whole series behind on BG, and I didn’t even realise that they’d made a new Earl … can’t wait.

Now  we just need a Series 3 of Heroes, one that doesn’t suck.

What shows are you waiting to watch, apart from those?



Web stores must provide better accessibility
April 2, 2008, 8:50 am
Filed under: development, ebuyer, opinion, webdev | Tags: , , , ,

According to a report by the Retail Bulletin, web stores must achieve better accessibility for their customers, much like bricks and mortar stores do.

This caught my eye because it mentions Ebuyer, and they rank pretty poorly, but then when you read the article in full, it’s not immediately obvious what they are measuring and they make no mention of how they gather their data, or asses the websites conformance to W3C’s Conformance level A (I assume that’s what the final column means.) The Error Occs column refers to some kind of error, javascript errors? html errors? schoolboy errors?

Does the meta data being “ok” mean that it has some, or that it’s relevant to the site? You have to assume they mean the meta header tags, which Google ignores completely. They might mean the content type & language settings maybe.

Finally they have an “Exact Overall” column, how they come up with this figure is a complete mystery. Tesco comes top with 8.04, their meta data is ok, they have no errors and all their pages meet W3C conformance level A. Thresers however comes 10th with 6.09, they fail at meta data, have 2 errors and 40% of their pages don’t meet conformance A. Further down the list is the Co-op, they are Ok at meta data, have 9 errors and only 19% of their pages don’t meet conformance level A yet they score just 3.56 and come in at #50. Furniture village has no pages that meet compliance, fails the meta tag test, but has no errors, and gets a score of 4.85.

Anyone beginning to notice a pattern?

No? Good because neither can I. There doesn’t seem to be any correlation between the “Exact Overall” score and any of the individual tests.

The site makes a very good point that high street stores have to meet certain accessibility standards, so why shouldn’t web stores? But when their own ranking system puts a Net-a-porter at number 9 with no pages achieving compliance level A, can you really take them seriously?



God hates LOLcats
April 1, 2008, 1:11 pm
Filed under: God, humor, i can haz cheezburger, lolbots, lolcats, lolgeeks | Tags: , , , , ,

Dead LOLcats

Even God hates LOLcats. I still don’t get them, they’re still not funny.



Sick of soccer pundits sticking up for their ex-colleagues

I’ve been listening to the radio a lot this week, especially to 5 Live where they’ve had various pundits on discussing Ashley Cole’s disgraceful show of petulance and disrespect for referees.

They’ve tried to convince us that the respect that rugby referees get from players wouldn’t work in football because rugby players get involved in punch ups, and that’s an even bigger lack of respect for referees.

I’m sorry but that’s just such a ridiculous argument, when was the last time you saw a rugby player argue over a referees decision? and when they do they get sin-binned for 10 minutes, or the ball gets moved 10 yards closer to their own try line (when was the last time you saw a free kick moved forward 10 yards for dissent?)

These ex-players also insist that dissent isn’t as widespread as people like to make out, but I went to watch Blackburn Vs Wigan yesterday and almost every free kick brought a reaction from them player concerned, not on the level of Ashley Cole’s petulance, but to say that it’s not widespread is rubbish.

Come on someone, have the guts to speak out about this, your making fools of yourselves and no-one believes you.

This post was originally made by me to FootyTechs, a community for geeks interested in Footy



Integrating YUI with Ruby on Rails.
December 19, 2007, 11:54 pm
Filed under: YUI, rails, ruby

Very often, different controllers require different javascript, and while you could just put all your javascript in your application.js file, this doesn’t doesn’t lend itself to anything more than the most basic of applications. It becomes very large, and hard to maintain.

The solution I use is to include any global javascript (prototype etc) in my application.rhtml and then use the controller name to load any specific javascript

<%= javascript_include_tag ‘prototype’ %>
<%= javascript_include_tag “application” %>
<%= javascript_include_tag controller.controller_name %>
(more…)



I’m starting my new year resolution early.
December 18, 2007, 2:36 pm
Filed under: Getting Things Done, diet, gtd

Anyone who knows me knows that I’m no Kate Moss, I’m no stranger to the words “fat bastard” or “tubby bitch”, even my son told me “you’ve got boobies” once. So with that in mind, it’s about time I started to try and lose the moobs, look a little less like Homer Simpson and shed a few pounds.

I’ve tried in the past, but the most successful weight loss program I had was Christmas 2000 when I had a bad fever and the runs. Not a diet I would recomend, nor one I’d like to try and recreate. My Problem, in all things, is motivation. I spend all day sat on my arse, when I get home from work, I sit in front of the TV or laptop, in short, I’m a lazy turd. The problem is, I LIKE sitting watching TV, I LIKE playing video games or tinkering on the lappy, I need some serious motivation for me to do something else instead.
(more…)



Porn on Countdown
October 30, 2007, 10:45 am
Filed under: Uncategorized | Tags: , , ,

We all new it !!

I was off ill yesterday, watching channel4’s Countdown, I nearly fell off my chair when I saw this.

A few people have said it’s fake, but I took the photo myself with my phone, no photoshop or other manipulation …