theChrisWalker.net

“at night the ice weasels come… ”

says Chris

Archive for the ‘Javascript’ tag

QR Code for Permalink
HTML5 WebSockets, very cool. (part 1)

with one comment

I only found out about these at the Future of Web Design on Tuesday. I knew they existed in the spec but had never really investigated what they were or how they worked. Now I know I am excited. It seems they are to web apps what the XMLHTTPRequest was when it started to get used for AJAX. So let’s look at what they are, and then why they can be so beneficial to web development. It’s also worth pointing out at this stage that only Chrome 4+ (I think that version, I’m writing from memory) supports WebSockets natively although apparently Mozilla want to implement them in the next iteration of Firefox (they are already available with an add-on), so don’t expect to be using them in any non-specialist projects just yet.

Read the rest of this entry »

Written by Chris

May 28th, 2010 at 2:45 pm

Posted in Not Code

Tagged with , ,

QR Code for Permalink
Xbox Live Gamercard API

with 2 comments

So, got decided to join most of my friends and I got an Xbox 360. Me being me though, I got interested in the way that all the information about your “Gamertag” is stored an accessible on the xbox.com website. Wouldn’t it be fun to do something with this data!

As it turns out, I was beaten to the post by Duncan MacKensie (http://duncanmackenzie.net/Blog/put-up-a-rest-api-for-xbox-gamertag-data) who hosts a webservice to retrieve gamer data from Microsoft. I could find no details about how this service works, where the data comes from or anything! Either he has a relationship with Microsoft, or he scrapes xbox.com but either way, the data seems pretty consistent and reliable. Actually it turns out this information was right there on his website… http://www.duncanmackenzie.net/Blog/if-you-are-wondering-where-i-get-my-xbox-live-info So he gets it as part of his membership to the Xbox Community Developer Program.

However, the webservice is great, and returns XML which is fine, but I thought it would be more useful to me to have a PHP API for this data. So I wrote one which retrieves data from Duncans webservice.

Read the rest of this entry »

Written by Chris

December 31st, 2009 at 11:34 am

Posted in Code

Tagged with , , , ,

QR Code for Permalink
Multiple Drag and Drop between two lists with jQuery

with 98 comments

I wanted this functionality for a project a while ago. I google’d and found that lots of others did too, but no one had done it. Or at least not in a way that I could understand. In fact, I’m not sure I completely understand it anymore. It works very well, but also it could have some improvement. I would like to be able to drag the mouse to create a selection, but this in itself poses the difficultly of how to distinguish a “drag-to-move” from a “drag-to-select”.

Still I found it an interesting proof-of-concept and maybe you will too. The test can be found here: Select and Drag Demo.

Written by Chris

February 10th, 2009 at 12:26 pm

Posted in Code

Tagged with ,

QR Code for Permalink
jQuery SuperSelect

with 2 comments

A little while back I was working on a project and wanted a selectbox to look a bit more pretty, but with complete backwards compatibility with regular select boxs.

I.E. If I already had a select box on the page, and it had various JavaScript events hanging off it already, I wanted that to function still but I wanted the box to be prettier.

The first idea was to use CSS to just style the box. But then I realised that each browser and OS has it’s own different way of rendering the controls. So I turned to JavaScript, and the always useful jQuery library. I wrote a plugin that will immediately transform any selectboxes into prettier ones, allows icons for the options, all with valid xhtml and works completely fine with JavaScript (or the plugin) disabled. Pretty cool, eh?

Well, I put the original demo page I designed for it back online, so check out the plugin!.

Written by Chris

January 29th, 2009 at 1:44 pm

Posted in Code

Tagged with ,