Monday, 23 June 2008

Anti-BNP Protest

So, on Saturday I went along to the protest against the BNP. This met at London Bridge (ish) and walked along to Trafalgar Square. This was the first protest that I've ever been to, so it was very interesting! I'm also trying to get up to speed on all of my 'isms... fascism, socialism, communism etc. I realise why I personally don't like the BNP's policies, but I'm not positive on how this fits into the 'isms.

Anyway, here are some pictures from the event:









And the rest can be found here:

Friday, 6 June 2008

Marks & Spencer - Plan A - What a joke!

So, the other day I wanted to buy some new jeans. I'm quite interested in where & how my clothes (and indeed, other products that I use) are produced; I try to purchase *ethically* produced clothing when I can. So, Marks & Spencer have this Plan A scheme which has five pillars: Climate Change, Waste, Sustainable Raw Materials, Fair Partner and Health. This sounds amazing, it is really amazing! In particular the Fair Partner section has the following information (taken from marksandspencer.com):

As an own brand, with influence over a quarter of a million workers worldwide, we have a golden opportunity to set new standards in ethical trading. For example, by extending our commitment to Fairtrade cotton we can directly affect the welfare of over 100,000 small-scale farmers. The extra income raised by fair trading also enables communities to invest in wells for clean water or improve healthcare facilities. The stories in this section will help you learn more about our efforts to improve the livelihoods of our suppliers and their communities all over the globe.

I've bought a pair of jeans from the Marks & Spencer in Jersey which were part of the Plan A scheme, so here in London I went to the Covent Garden store. There are signs on most walls talking about Plan A, but I could find no clothes. I ask the lady at the counter where I could find some of the Plan A clothes. She replied with something along the lines of "Plan what?"... she had no idea what it was. I had to explain that it was their name for the scheme which include fair trade products. "Oh yes, the Fairtrade clothes...... we don't have any". None at all, in the whole store, in London!!! I then went to the bigger store on Oxford Street and attempted to find some Plan A clothes there too... none (either that or they were hiding from me).

So, it seems as if Plan A is just the corporate image that M&S wish to push (and they do very vigourously), without actually following up on it at all.

What a joke.


Wednesday, 14 May 2008

FireFox double page load

OK... to anyone who's implementing a page counter.... if you find that the counter is doubling up when a request from FireFox (under OSX/Linux/doze) it's because the browser is loading the page twice. It's also due to how the W3C spec is written... and the behavior is entirely correct (if not a bit annoying).

If a browser find an IMG with an empty SRC tag then it should reload the page once more to check. I had an empty IMG SRC which was then dynamically assigned to with JavaScript.

To resolve the problem I just put a temporary image in place... which will never be seen because the containing div is hidden until the Javascript makes it visible again... at which point the correct image will be assigned to it.


Done!

Work around for Internet Explorer when dynamically changing Select Option

OK, so quite a common thing to do is update the items in a multiple select box with options sent from the server through some javascript.

And it's very simple.. you just get your response and stick it into the select box with using innerHTML on the select box. Unless you're using IE that is!

IE has a bug where is will remove the first OPTION when using innerHTML. It's only been there since 1999, so I'm sure they'll fix it soon! :P In the mean time check out this blog entry:

http://alexle.net/archives/150

Which has good info, or return XML from your server and parse it in the Javascript creating new Options as you go. This is how I did it, adapted slightly from 'Learning Javascript'.

try{
var opsnodes = xmlhttp.responseXML.getElementsByTagName('op');
for(var i = 0; i < opsnodes.length; i++){
var name = value = null;
for(var j = 0; j < opsnodes[i].childNodes.length; j++){
var elem = opsnodes[i].childNodes[j].nodeName;
var val = opsnodes[i].childNodes[j].firstChild.nodeValue;
if (elem == 'value'){
value = val;
}
else{
name = val;
}
}//end for j
sel.options[i] = new Option(name,value);
}//end for i
}
catch(e){
alert('Sorry there was an error');
}

where sel is the select box.

Interesting Sign


So, this was shown during the safety video on a bus near Oslo.... anyone wanna get in front of the bus to get the fire extinguisher? :-)

Tuesday, 13 May 2008

Bebo Application Development - Why no Javascript!!

So, I've built a Facebook application which uses the Facebook Javascript Sandbox. I mean, this is Web 2.0... of course it uses Javascript!

So, Bebo have (for a while now I guess) supposedly been code compatible with Facebook... however this seems to just be the FBML (or SNML as it now seems to be called). This is great.. but the lack of any form of JS support reduces the impact of being code compatible with Facebook.

I'll have to either we write the application to be rather static.. or rewrite it to not use any FBML and put it all in an iframe.


hmm.

Wednesday, 7 May 2008

Snow in London


It's hard to believe it at the moment (given our stunning sunshine!), but this was the covering that London received not to long ago: