Javascript cross browser property determination method


Therefore, it is recommended to use hasOwnProperty or typeof to judge the value correctly.

var sLeft = window.screenLeft;
if( !window.hasOwnProperty('screenLeft')) sLeft = window.screenX;