javascript - Incorporating google maps api into chrome extension/alternative to document.write -


i trying incorporate google maps api chrome extension. however, found out manifest version 2 not allow document.write. there way around this?

use callback url parameter when load maps api, , won't use document.write(). in normal web page might this:

function initmap() {     // create map object here usual }  function loadmapsapi() {     var script = document.createelement( 'script' );     script.src =         'http://maps.googleapis.com/maps/api/js' +         '?sensor=false&callback=initmap';     document.body.appendchild( script ); } 

documentation

example

i don't know how interact chrome extension, that's how it's done in regular web page.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -