Prev | Current Page 84 | Next

Frank Zammetti

"Practical DWR 2 Projects"

This object, a creation of Microsoft (believe it or not!), is nothing more than a proxy to
a socket. It has a few (very few) methods and properties, but that is one of the benefits: it really
is a very simple beast.
Notice the branching logic here. It turns out that getting an instance of the XMLHttpRequest
object is different in Internet Explorer than in any other browser (although it??™s worth noting
that in IE7, an XMLHttpRequest object is now available, which means the same instantiation
code can be used across browsers! However, to support the widest possible audience, if you
have to code manual Ajax, you will want to stick with this type of branched code, which still
works in IE7 as well). Now, before you get your knickers in a knot and get your anti-Microsoft
ire up, note that Microsoft invented this object, and it was the rest of the world that followed.
So, while it would be nice if Microsoft updated its API to match everyone else??™s, it isn??™t
Microsoft??™s fault we need this branching logic! The others could just as easily have duplicated
what Microsoft did exactly too, so let??™s not throw stones here??”we??™re all in glass houses on this
one! (Well, that??™s not technically true because Microsoft??™s implementation uses ActiveX,
which means only Windows-based browsers could really implement it the same way.


Pages:
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96