making sure to test if methods exist...

… before using them. Not all exist in all browsers.