Skip to content

Instantly share code, notes, and snippets.

View zerostyle's full-sized avatar
🌋
🌊

Joshua Stearns zerostyle

🌋
🌊
View GitHub Profile
@zerostyle
zerostyle / phone-prefix
Created June 12, 2012 18:26
Replace phone prefix
// Phone links
if (navigator.userAgent.match (/iPhone/i)) {
var a = document.getElementsByTagName ("a");
for (var i = 0; i < a.length; i++) {
if (a[i].getAttribute ('href').search (/callto:/i) === 0) {
a[i].setAttribute ('href', a[i].getAttribute ('href').replace (/^callto:/, "tel:"));
}
}
}