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 ); }
i don't know how interact chrome extension, that's how it's done in regular web page.
Comments
Post a Comment