Yesterday we shouldTry. These ()This function is also explained, because today we are talking about the encapsulated Ajax class library.
Try. These ()And try {} catch {...} in C {.....}} the same function is to execute a series of functions in order until one of these functions works normally. This seems useless (because javascrpt itself has a try {} catch (E) {} but in fact, it is very natural for you to use this item in some cases. For example, some statements Firefox is not compatible with IE, in this case, you can write two special functions for Firefox and IE respectively, and then use
<SCRIPT>
Function testtry {
ReturnTry. These(
Function () {specifically for IE },
Function () {specifically for Firefox}
); // Lu's blog: http://www.lvjiyong.com
}
</SCRIPT>
In this way, we do not need to check the browser type in advance. When it is IE, executeSpecifically for IEAutomatically jumps out, while Firefox is executingSpecifically for IECannot work normally, so we will continue to executeFor FirefoxThis makes us feel relaxed and can be applied to a wider range of applications.
It's raining. I'm busy first. Let's get here today.