Printed September 8, 2010 from B&T's Tips & Scripts
http://tips-scripts.com
JavaScript "One Liners"
Fot a multi-line alert, use "\n" for a the line break.
alert ('This is line one\nThis is line two');
If you want to test your website in different resolutions make a bookmark (or favorite) with the following as the link or location.
javascript:resizeTo(800,600);
Ensure your page is not opened in a frame by putting this JavaScript in the head section of your page
if (top.location != self.location) top.location.href = self.location.href;
Focus on an element when the page loads
window.onload = function() { document.getElementById('password').focus(); }
Remove special characters (or do other manipulation) with regx
item2 = document.getElementById('item').value.replace(/[^a-zA-Z 0-9]+/g,'');