JavaScript: Learning part 2 and telecommuting

Filed under: Development, JavaScript, Techy stuff — kathyjay at 8:00 pm on Wednesday, June 14, 2006

I am reluctanctly admitting that JavaScript isn’t as bad as I remember it. I distinctly recall tons of browser sniffing, JavaScript error messages and thoroughly ugly coding practises. That’s still what I usually see if I’m silly enough to go into a script archive looking for something.

But this DOM Scripting book is painting some really elegant coding. No inserting dozens of things that can’t be validated. XHTML Strict does not like onload or onclick events and I’d had no idea that I could put all of that in my external script file - it was one of the many things that kept me away from the stuff for the past couple of years.

There’s an emphasis on graceful degredation, something that is particularly important if you’re interested in accessibility. That means that, if your JavaScript functions aren’t working in your user’s browser for whatever reason, your page should still work even if the functionality isn’t as wizzy as initially intended. The example they’ve used in the early parts of this book is a really nice image gallery script (I’m probably going to be fiddling with it a little further and adding some styling to put into the gallery on this site) that updates a placeholder image in the page dynamically or just takes you straight to the image if the script can’t work. Much better, to me, than half a dozen JavaScript errors and an end result of never seeing any images.

The last time I attempted to learn JavaScript, there were lots of functions that only worked in certain browsers, absolutely no mention of statements such as document.getElementByID and all the examples did such useless things as putting scrolling messages in your status bar (kill those!!) or changing how half the browser worked without good reason. And it was all shoved into the HTML document with no mention of external files, promising hours of updating if any of the script ever needed changing.
I may even be converted to thinking that really good, well-formed JavaScript is a lovely thing.

In the spirit of National Liftsharing Day, shouldn’t we also have National Telecommuting Day? Far too many employers still refuse to understand why telecommuting could be a good thing for them and their primary objection is too often that they don’t trust employees to do the work. I’m not sure about other workers, but I generally get more done if I’m working from home than I do in the office. I tend to work longer and more intensively without distractions. We have the tech to do it well now, so shouldn’t more employers be actively looking for their staff to work from home a few days a week?

JavaScript and DOM: Beginning yet again

Filed under: Development, JavaScript, Techy stuff — kathyjay at 11:25 am on Saturday, June 10, 2006

It turns out that upgrading WordPress is much less painful than I’d assumed.

But to return to the topic, I’ve decided that it’s time for yet another stab at learning JavaScript. Why haven’t I managed this before? Well, it’s certainly not lack of programming ability!

My trawl through the first couple of chapters of “Dom Scripting” by Jermey Keith has reminded me of why I fall away each time. The language has a similar structure to most of the C-type languages such as Java, C++ and PHP. Now, I’m familiar with all of them so those initial chapters always teach me the structures that I already know. By the time the interesting stuff appears, I’ve moved onto learning something else that I can find a more immediate need for.

I’ve been a web denizen since 1999 and at that time JavaScript was essentially The Evil Language. Any website that implemented it had dozens of errors and it was usually put in as a “woo I’m clever” thing rather than for anything actually useful. Over the years, I’ve developed a fairly intense dislike of bad JavaScript and it’s only been over the last couple of years that JavaScript has been used well and unintrusively. The standardisation of the DOM has certainly helped here.

I genuinely enjoy learning new things, but unless it’s a college thing I usually focus on the things that I have an immediate use for. I’ve never had any need to use JavaScript in anything that I’ve worked on and the odd bits that I have used were picked up from magazines or tutorials and I’m good enough with languages to adapt things to what I need. PHP, on the other hand, I could see a use for which is why I sat down and learned it last year. I had a project in mind for it and it’s turned out very well.

JavaScript, though, is a necessity if I really want my web career to go anywhere so it’s time to hit the books again. This time I’m going to get past the “here is a variable, look at this for loop” section and actually find the stuff that I can use in the real world.

As an aside, am I the only geek out there who infinitely prefers using a for loop over a while? My colleagues at work seem to adore their while loops, but in all those cases a for loop would have been easier to read and maintain. Hmmm.

More Google discussion

Filed under: Development, Google, Techy stuff, Web analytics — kathyjay at 9:03 pm on Friday, June 9, 2006

Today I learned that I have visitors to my big site from further afield than I’d imagined. I’ve always known that I have visitors from the USA, Canada, Europe and Australia, but the Geo overlay from Google Analytics is showing hits from Singapore and Thailand. I can’t quite decide whether GA is accurate there or whether that’s the results of web proxies and unfortunately I’ve never had access to geographical splits before to be able to judge. It’s still rather interesting, though, and I’ll be keeping an eye on that.

I also learned that the majority of visitors to this site are based in the UK. Oddly, none of them so far use Macs but I’m sure that when I’ve got more than two days of data this will rectify itself.

A nice feature is the ability to download any of the data in several different formats, so that I could do further analysis on data if I so desired or insert graphs and charts into presentations. Again, none of the hosts or free packages that I’ve tried have offered that facility and I could see that being one of the selling points for big companies.

Being able to see how long people are spending on pages will also be useful. The site hosts a variety of content so I’m going to be interested to find out what people spend time on and what people gateway through quickly. And knowing the proportion of new and returning visitors is an important measure that I’ve never had before - the big site has lots of content, far more than can be absorbed in one visit, so I’ll be intrigued to see whether I’m getting mostly one-off visitors or whether there really is a decent sized core audience.

In other Google stuff, I introduced mother to Google Talk this evening. It was much less traumatic than I thought it would be. Now hopefully she’ll be able to talk her sister through it and they’ll be able to do more transatlantic gossiping.

I also took a tour around my father’s company’s new website. I’ve only had a few minutes, but it’s a definite improvement on the old one. It looks much better, more professional, and actually has a consistent design across the pages. An accountancy firm needs that kind of trustworthy design, I feel.

From an accessibility point of view, there are still some big improvements that could be made but it’s at least much better than it was. The horizontal drop-down navigation built in JavaScript is supplemented with a good sitemap and browsing it with images and styles turned off wasn’t too painful. There are elements that could be improved - web designers really should be trying to move away from tables used as layout - but at least it’s worth the money they paid this time. It will be going live next week and I’m going to be making gentle inquiries (*snort*) about it’s success not long after.

Google Analytics

Filed under: Google, Web analytics — kathyjay at 7:54 pm on Thursday, June 8, 2006

I am rather a sad geek, sometimes, and have a tendency to want to check out anything that Google is working on to see how well it does. Most of their products have worked very well, often better than their rivals’, so it’s always interesting to poke around in their Labs section or take a look at anything I see written up or discussed.

This week I’ve been playing with a couple of Google products. The first has been Google Calendar, which does exactly what it says on the box and I rather like it. Possibly if I didn’t already have a Google account then I wouldn’t have tried this out, but I thought it would be interesting. The real advantage to me is being able to transport my calendar between work and home easily, avoiding those potentially embarrassing moments when you double book yourself because you didn’t look at one or the other. For that, Google does a good job. The calendar is easy to set up, easy to log into and adding entries to it is fairly similar to adding entries to any other calendar package.

The only little niggles are the US-centric nature of their location information - they link into Google maps when you enter a location for an event but default to the USA. I somehow don’t think that I’m spending a week in Sidmouth Colorado this summer :-) That said, it’s a beta application so they’re sure to continue improving it and it fills the function I wanted. It’s also quick to run, which is handy.

The much more exciting product that I’m investigating is Google Analytics. I applied for an invitation code a few weeks ago and it was issued yesterday. I’ve already been in and set up profiles for two web sites to see how it works. It’s all quite simple and they provide the little JavaScript snippet that needs to be added to each page that you want to track. Setting up this site, Above the Fold, wasn’t difficult because it’s a fairly small site and it’s all been modularised in PHP, so I just had to add the code to the footer file.

The other site hasn’t been completely set up because it has around 150 pages to add the code to. It’s my fannish site, which has grown rather large over the years and it’s the one that I’m most interested in having a peek at. One day I will set up the entire site in PHP to make these changes easier. For now, the reviews section (built on a PHP/MySQL backend) has been added to Analytics because that’s just a case of adding the snippet to a footer file and a few templates. I’ve also added the major indexes and all the pages for another entire section. I’ll get to the rest of the pages over the weekend.

I installed the code and did the various set ups in the analytics panel yesterday and took a look at my first bunch of data tonight. I have to admit that it’s much more detailed than what I have available from my ISP. Just looking at the first page gives me more data. One of the nice features in that first page is a map that shows where my visitors are coming from with dots appropriately sized to the number of visitors from that location. It’s even differentiating between parts of the USA. The host for that domain has never been able to track geographic location.

It’s handling the dynamic content with ease, another point that my host hasn’t got, so I can start to see exactly what people are most interested in on the reviews section. Analytics shows me the full URL with the apended variables, rather than just saying “quick_search.php” without that breakdown. That will be handy.

It gives me lots of information on entry and exit points in the site, something that I’ve never been able to track, and should give me trends over time for that stuff. Knowing which pages are immediate bounces will also be useful.
One of the really useful features is a navigation overlay. It loads up my site with little clicky things over any links so that I can request more information on who is using those links. Very handy for improving navigation.

Keyword search information is also much more detailed than my host provides and I can track that information over time. I’ve previously relied on wading through screens of referral data from search engines.

There’s lots of good information on browser, platform and screen resolution with a couple of surprises - apparently I have visitors using Safari on Linux and barely anyone using 800×600 resolution. 1024×768 is the favourite. 12% of yesterday’s visitors use Firefox on windows.

I’m going to be delving down further as more data is gathered, but at the moment I can safely report that Google is right when it says it’s one of the most powerful analytics packages out there. And it’s all free.

Unusual but effective design

Filed under: Unusual designs — kathyjay at 9:17 pm on Sunday, June 4, 2006

Today was my sister’s birthday so I’ve spent the day in London with my parents visiting. My sister is an arty girl, always good at hunting out the quirky or unusual and today’s meal destination was no exception. We went to a place called LMNT, a very good restaurant with rather odd decore.

If you can imagine a place that used to be a pub and is now a gastro bar, decorated like a rather gaudy Ancient Egypt with bits of Ancient Greece and Rennaisance Italy, then you’ll be fairly close. It sounds rather tacky, but the detail in the designs made it something else entirely. There were booths that had to be approached by stairs, a ceiling like a tent, a massive glittering gold Sphyinx and the bar was decorated with inlaid old coins. My sister and I have decided that we need to go back and have dinner in the booth inside an enourmous urn.

The food was very good, too, and it’s certainly not a place that I’ll be forgetting in a hurry.

In other thoughts, could someone please make all those St. George flags go away? It’s nice to see everyone supporting England, even though we have no hope of winning, but the flags are getting very OTT and the tournament hasn’t even started.

« Previous PageNext Page »