var baseURL = "http://maps.google.com/maps/api/staticmap?zoom=12&size=400x400&maptype=roadmap&sensor=false¢er=";
var address = $(this).val();
if(address.length < 5) $("#mapPreview").attr("src", "spacer.gif");
else $("#mapPreview").attr("src", baseURL + escape(address));
Enter your address:<br/>
<textarea cols="30" rows="2" id="address"></textarea>
<img src="spacer.gif" id="mapPreview" width="400" height="400" title="Map Preview">
I begin by creating a bind to "keyup" event on the textarea. I get the value, and if it is too short (I chose less than five after many hours of research - really) we set the image's source to a blank image. If not, we point to the static map API and pass your value as the address. Try it below.
For an interesting test, try typing "lafayette, la", then remove the "la" and change it to "in".