Skip to main content

Posts

Image links in IE8

While mocking up a design page for a colleague's website I came across a new browser behaviour in IE8. This was the first time I used IE8 as my main development browser, due to the fact that the PC was re-installed and high-priority updates were applied. Surprisingly Microsoft branded IE8 as a priority update. Anyway, back to what I was talking about, here's a sample: <a href="index.htm"><img src="logo2.jpg" alt="Logo" title="Logo" /></a> As you can tell, this is using an image for a link, where it behaves well in Chrome, Firefox and in the previous versions of IE (7 and older). But in IE8, this is not the case as the DOM does not treat the image as innerText, only as a child node. As a result, everytime I hover the mouse over this image, an extra gap would come from nowhere shifting any relatively positioned elements. To fix this I explicitly added a space (&nbsp;), so the line would look like: <a href="inde...

SQL Replace

A colleague recently asked me if it was possible to replace a string in SQL. After a bit of questioning, this is because entities like & in HTML would be encoded to &amp; in his database. Since it was the case of outputting information from a SQL statement, this can be simply done by using the REPLACE function in the SELECT . For example: SELECT REPLACE(CompanyName, '&amp;', '&') FROM Company The same concept applies in Crystal Reports.

Remote Desktop Copy & Paste

Here's a little tidbit. When I used to Remote Desktop onto client machines, they would disable file transfers as part of their security procedures. One way of transferring files in Remote Desktop is to allow the remote session use your local drives, so you can still navigate your computer from within the session, which is quite slow. Then you would have the ability of using the clipboard to copy & paste content from one file into another. But if you want to copy and paste files themselves, this is possible by enabling both of the above. It is a bit slow but it is more convenient and quicker then trawling your local drives slowly to find the file only to face a slow drag and drop procedure.

Free Nero

It's official. The creators of the popular CD/DVD burning software, Nero, has released a free version of it's flagship product for Microsoft Windows. Not to be confused with the 15 day trial, the free version of its software is limited to only the simple task of burning CDs and DVDs. Their website states: "This version of Nero 9 contains simply data burning and disc copying features for CDs and DVDs. Additional features and functionality are available with an upgrade to Nero 9 full version." Of course, many would have turned to the likes of other freeware and open source software such as CD Burner XP Pro (my favourite piece of kit by the way) or ImgBurn . However, Nero's offering maintains their trademark interface and the use of SmartStart for novice users, which many would prefer. You can download it from here .

Microsoft Bing

It's nice to see the Press taking a much more keen interest in technology and gadgets. So I wasn't that much surprised when the Metro covered the launch of Microsoft Bling. Currently in beta Microsoft is obviously renewing their competition against Google. I've also noticed that Microsoft has recently replaced the Live search with Bing on their MSN page. But after using it, why do I get the impression that it's just copying Google with a more colourful interface?

Javascript form validation

One of the most popular uses of Javascript is when it comes to validating user input on a form. The most hateful way, though, is by not using onsubmit. A number of times I come across code where someone uses an image in place of the submit button and uses the onclick event which will validate then submit the form. Yeauch! Very bad practice! The first thing to do with the form is place the Javascript function in the onsubmit attribute for the form, e.g. <form name="reg" method="post" onsubmit="return validateForm();" The use of return lets the form submit when the function returns true. If the function does not return true (i.e. false) then the form will not submit - as shown below. function validateForm(){ return false; } Getting a reference to the form is the next step. There are a number of ways to do this: document.forms[0] document.forms['reg'] document.getElementById('reg') This will work when id is used on the form Passing an o...