Skip to content

when javaScript goes wrong

Old content alert!

Thanks very much for visiting my blog. Always happy to have people read my stuff but just thought I should point out this post is years old. If it's about technical stuff there is a possibility that it is no longer relevant, if it's a bug report/fix I'm hoping that it should now have been fixed.

Of course if this is what you're looking for and it does work then great, just don't say I didn't warn you...

Everyone loves JavaScript now don’t they!?!

It seems that every couple of weeks I see a new fully web 2.0 application spring up which after a while you wonder how you could ever live without; I have started using the new Yahoo! mail with all its drag and drop fun constantly and without (many) hitches, plan to create an interactive Google map for the LSBU website and constantly enjoy looking into the possibilities which the main 4 JavaScript libraries provide developers – I’m like a big kid in a candy shop!

With all this fun stuff going on I can see the fact that people are clearly going to get excited and use this available functionality as much as possible in their sites to ensure it looks professional, cool and up-to-date – but haven’t we actually been here before??Wasn’t all this guff the things which made the web suck so much in the early 90′s???

I’m sure all this stuff has been said elsewhere but I was having a look round our website and came across this little beauty on our accommodation office website – I am especially talking about the left navigation; I thought it was just a simple bit of CSS used on hover but then I saw that the link destination weren’t showing in the address bar and the alarm bells started ringing! A bit of investigation lead me to this little beauty <tr>
<tdclass="laccom" id="costs" OnClick="gotourl(URL3)" onMouseOver="overTab('costs')" onMouseOut="outTab('costs')"><script Language="JavaScript">document.write(label3)</script>
<noscript><a href="/housing/costs.shtml" class="accomm_left">Costs</a></noscript></td>

OK; deep breaths – this is just crap on a number of different levels –

  • JavaScript is being used to write the link text into the document
  • JavaScript is being used to provide a rollover on each “link”
  • JavaScript is being used to provide an onClick for each link – sending the user to the destination specified elsewhere in the page – via another set of JavaScript vars
  • a standard link is provided if JavaScript is turned off

in other words JavaScript is used in order to provide – a standard link – you just don’t need that stuff!!!!!!

I hope that we don’t go back to this kind of situation; where developers add on a few extra hundreds by developing useless code which really does nothing and is inaccessible – we can’t let all these new tools and potential abilities fall into the wrong hands.

No comments yet

Comments are closed.