Archive for the ‘Javascript’ Category

Converting HTML to PDF using EvoPdf

We have been using ABCpdf to generate PDFs on the fly of the page currently being browsed. It has given us years of service, but now with the new version of our site I have had to find an alternative solution as my page body gets styled out of sight and then moved into position [...]

More »

Detect browser window focus

The scenario: You have a link that creates a hidden iframe which generates a file download (a pdf of the current page in my example). You have cleverly given the user some visual feedback in the form of an animated ‘waiting’ gif and you would like the clever animation to go away once the user [...]

More »

Getting destination page to reload after back button is clicked

I found that in certain cases that the back button was causing much mayhem on my site as the code is not reloaded and therefore caused some unwanted behaviour. So here’s my cross-browser fix that I have devised after much googling. For a change IE was not the challenge, but rather Firefox as the onload [...]

More »

Using Javascript to validate South African ID Numbers

I have just finished a neat little client side ID number validation script that ensures that the ID number passed is: Numeric, is 13 Digits long, has a valid date with the first 6 characters and passes the Luhn algorithm test. function ValidateIDnumber(idnumber) { //1. numeric and 13 digits if (isNaN(idnumber) || (idnumber.length != 13)) [...]

More »