title: Primefaces gmap doesn't show after click on p:commandButton (ReferenceError: google is not defined )
body: <p>I see gmap just after update page. If I don't update page I get error in chrome console</p>
  
  <pre><code>Uncaught ReferenceError: google is not defined index.xhtml:1
  Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened. 
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;h:body&gt;
      &lt;ui:composition template="/WEB-INF/template/layout_template.xhtml"&gt;
          &lt;ui:define name="windowTitle"&gt;
              Admin Panel
          &lt;/ui:define&gt;
          &lt;ui:define name="content"&gt;
              &lt;h:form&gt;            
  
              &lt;div class="panel panel-default"&gt;
                  &lt;div class="panel-heading"&gt;Map&lt;/div&gt;
                  &lt;div class="panel-body"&gt;
                      &lt;p:gmap type="roadmap" center="50.00, 28.00" zoom="8" style="width: 1000px; height: 400px;"/&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;/h:form&gt;
  
              &lt;!--&lt;h:outputScript name="app/google-map-loader.js" library="js" target="head"/&gt;--&gt;
              &lt;script src="https://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"&gt;
              &lt;/script&gt;
          &lt;/ui:define&gt;
      &lt;/ui:composition&gt;
  
  &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My footer template</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
          &gt;
  
  &lt;body&gt;
  &lt;ui:composition&gt;
      &lt;div class="bottom-nav footer"&gt; 2013 &amp;copy; by Me&lt;/div&gt;
      &lt;!-- jQuery (necessary for Bootstrap's JavaScript plugins) --&gt;
      &lt;script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;h:outputScript name="lib/bootstrap.min.js" library="js" target="body"/&gt;
      &lt;h:outputScript name="app/smooth-sliding-menu.js" library="js" target="body"/&gt;
  &lt;/ui:composition&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I read in doc <img src="https://i.stack.imgur.com/9NgBt.png" alt="script position"></p>
  
  <p>But I don't want put gmap script in head of main template. Is it posiible to make it work without redirect. And is it possible to add script in head of child template </p>