Code: Assume default values

Chapter 8 - Ajax Optimization

Consider the use in Ajax of the open( ) method. You must specify the method and URI, but you do not have to pass in the final Boolean value of true to achieve the default asynchronous nature of an Ajax request. So, this:

xhr.open("GET","sayhello.php",true);

becomes this:

xhr.open("GET","sayhello.php");

And thus, we kiss five more bytes goodbye.