Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing modernizr.js / yepnope.js to load Google Maps API
    primarykey
    data
    text
    <p>Does anybody have any working code that allows one to use modernizr.load or yepnope to load the Google Maps API?</p> <p>I am able to load JQuery &amp; GMap3 using modernizr, however Google Maps API doesn't work unless I make a traditional script tag.</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;Please help me load Google Maps API with modernizr!&lt;/title&gt; &lt;style&gt; #map { width: 500px; height: 300px; } &lt;/style&gt; &lt;script src="/js/modernizr-2.6.2.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Please help me load Google Maps API with modernizr!&lt;/h1&gt; &lt;div id="map"&gt; Placeholder &lt;/div&gt; &lt;script&gt; function pageInit() { $("#map").gmap3({ map:{ options: { center: [18.01714, -76.750113], zoom: 15, mapTypeId: google.maps.MapTypeId.TERRAIN, } } }); } &lt;/script&gt; &lt;!-- I WANT TO REMOVE THE SCRIPT TAG BELOW AND REPLACE WITH MODERNIZR LOAD! --&gt; &lt;script src="//maps.google.com/maps/api/js?sensor=false&amp;amp;language=en"&gt;&lt;/script&gt; &lt;!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --&gt; &lt;script&gt; Modernizr.load([{load: [ '//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', '/js/gmap.jquery-5.1.1.min.js', ],complete: function () {loaded();}},]); function loaded() { $(document).ready(function() { pageInit(); }); } &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Well logic tells me I should do the following change after removing the script tag:-</p> <pre><code>Modernizr.load([{load: [ '//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', '//maps.google.com/maps/api/js?sensor=false&amp;amp;language=en', '/js/gmap.jquery-5.1.1.min.js', </code></pre> <p>But if I do this change the map doesn't load and I now get this error in the Javascript console:-</p> <pre><code>Load denied by X-Frame-Options: http://maps.google.com/maps/api/js?sensor=false&amp;amp;language=en does not permit cross-origin framing. </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload