Give your map_canvas
div a fixed width and height, and your example will work fine:
<div id="map_canvas" style="width: 500px; height: 400px;"></div>
Otherwise, set the height to your html
and body
as Google does in the API tutorials:
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>