Uncaught TypeError: Object #<a Document#> has no method ‘write’

Error Conditions:
This issue happens when you use GMaps4JSF with Google Chrome (also Safari) in Facelets XHTML files (The default PDL for JSF 2.0). Actually this issue generally happens when you make make any include to Google Maps inside XHTML files:

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAAxrVS1QxlpJHXxQ2Vxg2bJBQdkFK-tWRbPPQS4ACM1pq_e-PltxQXeyH20wQuqDaQ_6EM5UeGGVpnIw"> </script>

Just set the content type to “text/html”:

<f:view contentType="text/html">