문제

i have a webpage which is housing my iFrame which is from a different domain. Now i have a button inside the iFrame which when pressed, needs to refresh or reload the iframe.

I've tried a few methods which are blocked due to cross domain attempts..

도움이 되었습니까?

해결책

In your script within the iframe, try this:

document.location.href = document.location.href;

You can't access elements outside of your document model from within the iframe, including accessing the iframe itself. You can access the properties of the document within it however.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top