This is my first attempt at putting together a javascript toolkit all in one place.
function checkMail(email){
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(email)) {
return true;
}
return false;
}
window.addEventListener('load', setOrientation, false);
window.addEventListener('orientationchange', setOrientation, false);
function setOrientation() {
var orient = Math.abs(window.orientation) === 90 ? 'landscape' : 'portrait';
var cl = document.body.className;
cl = cl.replace(/portrait|landscape/, orient);
document.body.className = cl;
}
Some people seem to like definition lists
- Lower cost
- The new version of this product costs significantly less than the previous one!
- Easier to use
- We've changed the product so that it's much easier to use!
ID | Name | Rank |
---|---|---|
1 | Tom Preston-Werner | Awesome |
2 | Albert Einstein | Nearly as awesome |
I get 10 times more traffic from [Google] 1 than from [Yahoo] 2 or [MSN] 3.