How to solve the problem that Google maps cannot be opened _ javascript tips-js tutorial

Source: Internet
Author: User
This article mainly introduces how Google maps cannot be opened. This article provides a Google Map call case that can be used normally. If you need a friend, refer to Google Maps being blocked by the Chinese firewall, so don't directly reference http://maps.googleapis.com/maps/api/js? Sensor = false & language = en this domain name under the Google map api, but instead to http://maps.google.cn/maps/api/js? Sensor = false. The domain name of google.cn in China is not banned and can be used.

Note: Although google.cn can be used, some js resources referenced to google.com will be output, leading to the latency of map presentation. Therefore, do not put Google map APIs in front of your content, for example, the head label is placed at the end of the content or html end tag to prevent the content on your page from being blank and the browser cannot display the content.

Do not use Windows. the onload event is to be drawn, or Google Map Display is not timely, because the google.com resource is to be loaded, and the google.com resource is intercepted, it will lead to the request timeout (about 2 minutes) to draw a Google Map.

The callback parameter of Google is used to pass a callback function name, which is faster than the window. onload event.

Sample Code:

 Google maps cannot be referenced on a website. Solution: Use google.cn

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.