I think many people have made some very good points, and I will only add a small caveat:
If you are buying a new gun, then it really is a matter of personal preference, comparasin shopping, and personal ethics regarding online vs. brick and mortar stores.
If you are buying a USED gun, I strongly reccomend being very cautions making those transactions online. I have 2 shops that deal almost exclusively with used guns, and that way I get to put my hands on them and determine their level of wear. Buying a used gun online should be done carefully, through a reputable site, and with an understanding that you may possibly get cheated with little available recourse (obviously not extremely likely, but possible).