AJAX - The Complete Reference

(avery) #1

Chapter 2: Pre-Ajax JavaScript Communications Techniques 21


PART I


might not properly support these lengths.” Yet markup specifications, including the older
traditional HTML specification based upon SGML, indicate a limit of 1024 characters, which is
quite a bit larger. Finally, if you actually go and carefully test browsers, depending on browser
versions and even operating system, you may find limits as low as 2083 characters on certain
versions of Internet Explorer and much higher values for other browsers. The definitive answer
is difficult to pin down, but you shouldn’t be passing lots of data via a query string as it might
not make it to the server; instead you should use the HTTP POST method. Unfortunately the
Image object technique can’t invoke the HTTP POST method, but the next method presented,
the iframe, can.

NNOT EOTE Even if you think you won’t get to these limits quickly, add in character encoding and you
certainly will. Consider, for example, encoding the three double-byte Japanese characters

that mean “Japanese language,” pronounced “nihongo.” As in romanji, it would convert into an
escaped character string of %E6%97%A5%E6%9C%AC%E8%AA%9E when used in a URL.

FIGURE 2-2 Image-based communication example in action
Free download pdf