A fail-safe or fail-secure is one that, in the event of failure, responds in a way that will cause no harm, or at least a minimum of harm, to software apps, nor disrupt end users.
For example:attachEvent is deprecated, you can first check the addEventListener function availability on the browser and then use attachEvent as a fail safe scenario. (http://msdn.microsoft.com/en-us/library/ie/ms536343(v=vs.85).aspx)
if(window.addEventListener){ window.addEventListener("click", functionA, false)}else if (window.attachEvent) { { window.attachEvent("onclick", functionA)}
0 nhận xét:
Đăng nhận xét