1

This one just sents me troubleshooting for a bit, so I thought it may be worth a Q&A format.

Q: I'm trying to asynchronously load google maps via API (something similar to this) But google maps loader complains

Execute write on doc: It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened

2 Answers 2

1

Taken from a similar question

Specify &callback=someWindowFunction in your api request and document.write won't get called

Sign up to request clarification or add additional context in comments.

Comments

0

A: It's possible that your url string just has a typo. Lets say you played with args and ended up with

url = https://maps.googleapis.com/maps/api/js?v=3.exp?callback=callback

google maps won't recognize the callback option and fetch the sync js script that uses a call to document.write(), instead of loading the correct async version. You can check for yourself, if after load you have a maps.googleapis.com script maps/api/js?v=3.. and it contains a getScriptcall containing document.write(), you've ended up in the wrong (sync) version..

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.