开发者

grant access to Location to framed external site

开发者 https://www.devze.com 2023-02-02 20:04 出处:网络
I\'m iframing an external site. That site tries to call location from parent for analytics reasons and access is refused (for obviou开发者_如何学Pythons default security reasons) .

I'm iframing an external site. That site tries to call location from parent for analytics reasons and access is refused (for obviou开发者_如何学Pythons default security reasons) . Yet I would like to disable that security and answer, because that site is a 'friend' but not on the same domain. Seems impossible to grant that access... any idea ?


I ran into a similar situation before. Allowing for cross domain javascript access through iframes is not possible since this would result in a cross-scripting-attack nightmare. Like the other poster said, you will have to post this data to them yourself. One way to fix this is to set a cookie that can be read by the other domain with whatever information they are looking for then they can read the data from the cookie. Javascript can set to the cookie when you load the other site in the iframe. For a function to do that, check http://phpjs.org/functions/setcookie:509


If the site is a 'friend' as you say - how about passing them the location data yourself?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号