Iframes and Fancybox

Asked

Viewed 125 times

0

I’m looking to open one iframe Google Maps in a Fancybox via fancybox.iframe. But it makes the following mistake:

No 'Access-Control-Allow-Origin' header is present on the requested resource.

I know the explanation about something cross-Domain and that ajax does not do this but, there is some solution?

1 answer

1

Put this on your . htaccess to release external search to any site:

    <FilesMatch "\.(*)$">
      <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "*"
      </IfModule>
    </FilesMatch>

or only for maps:

    <FilesMatch "\.(*)$">
      <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin: https://maps.google.com
      </IfModule>
    </FilesMatch>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.