How to Make a Mobile Site Click to Call Link

A “click to call” button or link on a mobile or smartphone website can mean the difference between getting a customer to call or losing them forever. Converting customers with mobile sites is a different discipline from converting customers on desktop websites: mobile website visitors are unlikely to read long sales copy, are similarly unlikely… Continue reading How to Make a Mobile Site Click to Call Link

Javascript to replace broken images

Basically you want to handle the onError event for the image to reassign the source. This can be done without jQuery: function ImgError(source){     source.src = “/images/noimage.gif”;     source.onerror = “”;     return true; } <img src=”someimage.png” onerror=”ImgError(this);”/>

Support Tabs in Textareas using Javascript

Normally the tab key moves to the next focusable thing. This inserts a tab character in instead. var textarea = document.getElementsByTagName(‘textarea’)[0]; textarea.onkeydown = function(event) { //support tab on textarea if (event.keyCode == 9) { //tab was pressed var newCaretPosition; newCaretPosition = textarea.getCaretPosition() + ” “.length; textarea.value = textarea.value.substring(0, textarea.getCaretPosition()) + ” ” + textarea.value.substring(textarea.getCaretPosition(), textarea.value.length);… Continue reading Support Tabs in Textareas using Javascript