All posts filed under

javascript

 

How to: understand HTML5 without getting confused and annoyed.

HTML5 is a good general upgrade to HTML4, the basic language of web pages. It adds a couple of new features that allow you to play video and sound without using a plug-in such as Flash. It has some data handling tools too. That's it.

Sorry, I didn't promise that every how-to would be exciting. This one is aiming more for ‘informative’. If you read to the end, I’ll throw in some jokes. Fair?

I’ve vaguely heard of HTML5. If it’s so dull, why the hype?

Many of the HTML5 demos you’ll see are full-on multimedia eye candy. Where’s all this bling come from?

What’s happened is that other things have become confused and associated with HTML5.

  1. A fistful of handy design and typography features used to make designs richer in the styling system called CSS.
  2. Lots of work on making animations work without Flash by people who don’t like Flash.**
  3. Lots of work by people who want to update bits of a page on the fly without the whole page refreshing.

Most of the cool new animation and interactivity stuff is done with that scripting language called JavaScript. And most JavaScript works on pages written using boring old HTML4 too. It may take a bit longer, but it can be done. The typography stuff can be done with existing browsers too: it’s a bit of a faff, but it’s do-able. This is good news, as half the browsers people use don't understand HTML5*.

Cool HTML5 demo’s that only work in some browsers:

http://www.hongkiat.com/blog/48-excellent-html5-demos/
The demo’s only work in recent versions of Safari, Firefox and Chrome and IE9

Why do you care about HTML5?

Together, these things allow us to deliver websites that are a real pleasure to use: where everything feels slick. It’s the little things, like revealing and hiding text with a pleasing slide, so much nicer than the clunky ‘wait and re-arrange’ of a full page-load. Or the searches that suggest things to you before you’ve finished typing. Or forms that turn green the second you’ve filled them in correctly.

HTML5 makes it easier to tie all that stuff together, but it’s not mandatory.

Where’s the sell?

The reality is: we know it's not mass-market yet. Not until browsers that understand HTML5 outnumber those that don't by about 20:1. That’s about 2 years away.

It doesn’t matter: all that niceness is here, now. Yes. Your sites can be effortlessly cool even without alienating the technologically challenged! So, to find out about a whole heap of cool grooviness, give Frank and Jules a shout on 01422 847958, or email make.it.work@welovetheweb.com

* Internet Explorer versions 6, 7 and 8 don't understand HTML5 properly. These browsers make up about 40% of the browser market. Internet Explorer 9 does get it.

** The iPhone and iPad don't do Flash because Steve Jobs banned it from iThingies. I think he got grumpy that Adobe (who make Flash) never made a Mac version of Flash as good as the Windows version. Flash runs fine on Android phone, so it's just industry politics keeping Flash off your Apple fondleslab. Dear sweet Lord, the politics of IT are dull. Quite apart from that, a lot of programmers don’t like Flash because Adobe own it,make lots of money from it and are a bit of a pain. And a lot of programmers also hate flash adverts. 

If you have a friend or colleague who you think might like to receive these emails, get them to sign up for the We love the web newsletter.
We won't share their email addresses with anyone else and we won't send through huge numbers of mails, just these how-tos, well, and the very occasional sales pitch, but we promise not to be 'in your face' about it.

Oh yes, jokes.

OK, top three jokes from this year's Edinburgh festival:

  1. Nick Helm – “I needed a password eight characters long so I picked Snow White and the Seven Dwarves.”
  2. Tim Vine – “Crime in multi-storey car parks. That is wrong on so many different levels.”
  3. Hannibal Buress – “People say ‘I'm taking it one day at a time.’ You know what? So is everybody. That's how time works.”

As you were.

Carry on.

Filed under  //   Digital Account Management   HTML5   how-to   javascript  

Comments [0]

Javascript

Now there's a headline to conjure with. Just dropping the word casually into conversation at parties has young ladies flocking from all corners of the room, hanging breathlessly on my every word.

Back in the real world, javascript is the 'other' language that you are allowed to use on the web. HTML handles all the content, javascript does all fancy effects. It makes Google maps slide smoothly around the screen, Facebook posts appear without the whole page reloading, it underpins the auto-completing search on eBay and helps remember who you are when you come back to a page. In short: tremendously useful.

Unfortunately, it's awful. Total rubbish. Complete crap. Honestly, of all the languages you could have chosen to run the internet, this is the worst one, bar none.

Why?
It's as slow and unreliable as a 1975 Morris Marina, as unpredictable as an MP on acid and deliberately hamstrung by design so that it can't do anything harmful (although that hasn't stopped hacker types from finding ways to use it for evil).

This weekend, tired of being relentlessly pestered girls at parties, I decided to stay home and muck about with jQuery instead. jQuery is a code collection, written in javascript, that automates a lot basic tasks for you. We've been using it at We Love The Web for ages now as it does a lot of helpful stuff. It's useful because lots of people have spent lots of time overcoming the bugs in all the different browsers' javascript implementation.

Now: stop a second and think about that last sentence. That's right: the language that runs most of the internet works differently in every browser. So unless you use a Library like jQuery, you'll probably have to write at least four different versions of your code, each tuned to the peculiarities of a different browser. Does my ranting about how rubbish it is start to make more sense now? Imagine if you had to write every sentence on your website in Geordie, Mancunian, Received Pronunciation and Scots, just to make yourself understood. That would get annoying really fast.

So, back to my supersexy weekend. I set out to mock-up a glitchy text-based animation thingy in a few lines of code. I wanted to experiment with using jQuery and see if we could reduce our reliance on flash for motion graphics. Keep it simple, keep it fast, I thought.

The result isn't going to set the design world on fire, nor is it intended to - it's just a scrap of test code. You can see it here: www.welovetheweb.com/black3.html, neatly highlighting many of the problems with javascript in one simple page.

I'm not asking the computer to do anything hard: change the colour and size of some text. It's only about 20 lines of code. That's less than 1Kb. So why should it behave so unpredictably? It:

  • Stops arbitrarily for a second or two in Firefox from time to time.
  • Barely even runs in Internet Explorer 6.
  • Strobes eye-bleedingly fast in Safari on a Mac.
  • Looks rubbish in Internet Explorer 7, but quite cool in Chrome.
  • Runs at completely different speeds in each browser you test it on, even on the same computer.
  • Runs at achingly slowly on anything other than a fast, up-to-date computer.
Bear in mind that I was using a code library specifically designed to iron out the differences between browsers. It's just mental. If you were running Office on javascript, it would take about 10 minutes to load and a simple spell-check would take about half an hour.

How on earth could we possibly rely on something that flaky to try and get stuff done?
Why on earth do we put up with it?

I dunno. I sometimes think us Geeks *like* coding to be difficult, it's how we define ourselves: by being able to do things with computers that mere mortals can't. We'll put up with having to type 100 pages of gibberish without so much as a comma out of place (or it all goes wrong). And we do it willingly, in fact we even enjoy it.

That's the bit I really don't get - why we Geeks are drawn to computers so inexorably. I guess it's the same fascination that people had in days gone by for clockwork or steam engines - an overriding desire, when confronted with a machine, to know how it works and why. An itch to understand that just won't go away. That urge can overcome everything: even our equally natural desire to smash the thing to bits with a big brick when it just won't bloody well work, even after we've poured hours and hours into it!

So yeah, I've got a couple of party invites to look over now or, alternatively, I could read up about the document-object-model differences between Firefox and IE's javascript implementation.

Ooh, the agony of choice.

Filed under  //   code   javascript   parties   web development   young ladies and fun  

Comments [0]

Chrome

Google's new browser could change everything about how you use your computer. This isn't really a post about their browser, however, more about who controls your business-critical data.

Chrome is the first browser that really tries to turn Javascript into a language that you can use for serious application development. Ah, that's technical and I've lost a lot of you right there: but it's important.

Google docs, Google's Microsoft Office 'killer' runs on Javascript.

We use Google spreadsheets here at We love the web, mostly for bug-sheets and progress tracking. We love the fact that we no longer have to email people lots of spreadsheets or get them to use an unfamiliar bug-tracking tool: they can update an online spreadsheet that they already know how to use and we get their updates instantly. These work well until they get to a certain size. They then start crashing our web browsers with annoying regularity. So, if Google docs were more reliable they would be a compelling proposition:

Google docs: Free, requires no maintenance, setup in minutes, instant online collaboration
Microsoft Office: several hundred pounds, complex install that requires regular patching and support, rubbish online collaboration

There are only two ways to do instant online collaboration through a browser: the flash plugin and Javascript. The flash plugin is wholly owned by Adobe and Google wouldn't want to be in hock to Adobe for a key plank in their strategy. That leaves Javascript.

Javascript is pretty awful: slow, unreliable, inconsistently implemented across Internet Explorer and Firefox, prone to falling over and not very secure. I've yet to meet a web developer who loves Javascript. You can do some great things with it, but mostly in spite of the language, not because of it.

This is the problem that Google seems to be trying to address with Chrome. It's the only real innovation in the browser for my money: a bullet-proof implementation of Javascript.

Everything else is pretty standard - Chrome is based on webkit, the same collection of code that Apple used to make Safari and a lot of the interface tweaks owe their inspiration to (have been copied from) an obscure, but well-regarded browser called Opera.

So, if Google docs would only work reliably then Microsoft really could become irrelevant: No longer would you fire up Word, Outlook and Excel when you got into the office: gMail and Google docs. would take over. Chrome is the tool that allows this to happen.

Hooray, you've saved hundreds of pounds per person in not buying Office!

Of course, there is a downside.

All your important business information would be held and maintained by someone else. Microsoft Office just provides the applications in which you work: you store your own data. Google Docs are stored, indexed and ultimately owned by Google.

Within days of Chrome's release, there was a right hoo-haa in the technical press when it was discovered that Google had put a term into the license whereby you granted a permanent and irrevocable license to Google to use, reproduce and distribute anything you uploaded through Chrome: photos, spreadsheet data; everything.

It was quickly removed, with an 'oops' style apology from Google, but that it was even there in the first place is worrying: that they ever thought this was reasonable. I don't trust anyone outside my accounts team with my financial information. Do you?

It's the same old story really: there's always a catch to 'free'. We use Google docs, and will continue to do so for lightweight online collaboration, but never for really important stuff. Think hard before you start entrusting business critical data to a third party. You never know where it could end up.


Note: There are various free office suites that work like Microsoft Office - the most famous is called Open Office, but there seems to be real resistance to it in business, possibly because many business people are nervous about an entirely free application suite that underpins the daily running of their business and isn't supported by a large company.

Filed under  //   Chrome   javascript   web development  

Comments [1]