문제

I have a website for my gadget files and I’ve made a windows 7 gadget with an iframe to connect to it. The problem that I’m having is that I need to somehow send a message using javascript. The best option for me was to try parent.loadPage(‘page’) and send that from the iframe (running on a different domain) to the function of the windows 7 gadget however it does not work. Does anyone have any ideas on this it would be greatly appreciated.

Just to clarify The iframe is connecting to a website e.g. (www.example.com/gadget/page.php) The page contains a link using onClick parent.loadPage

도움이 되었습니까?

해결책

In light of no direct answers, let me summarise...

The short answer is "no, you can't".

The longer answer is that the gadget is effectively a browser, and will therefore block any javascript communication between the iFrame and the parent due to cross-site scripting (XSS) protection.

Instead (assuming you have control over the content you're trying to display in the iFrame) you should look at bringing back the information you want to display via AJAX, and displaying it directly into the gadget.

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