简体   繁体   中英

Google maps issue: does not permit cross-origin framing

I am having a problem with the embedded custom google maps with iframe . It gives the error as below.

does not permit cross-origin framing.

And I want to change the content of the iframe to a "map cannot be displayed" picture. Or is there a built in trigger for the api, to send an error, not a blank iframe ?

My event handling looks like this:

if ($("#mapframe>iframe").contents().find('body').html().length == 0) {
   $(this).contents().find('body').html('<h1>Üres</h1>');
}

There is some restriction with origin policy . It is not possible to use a short link in this case.

The error tell you that URL that you pass is not suitable as a source for iframe . Here is example URL:

Load denied by X-Frame-Options: https://maps.google.com/?ie=UTF8&ll=48.858151,2.293611&spn=0.00648,0.021973&t=h&z=16 does not permit cross-origin framing.

Does not permit cross-origin framing iframe follow it also.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM