user993177
user993177

Reputation: 188

crossdomain iframe handling

Hi I have a question about iframes and crossdomains. The answers I found left me just confused. Some say it's possible, others say it's not possible. So I hope that someone here will give me the answer I've been looking for. so my question goes like this:

for example I have the website: www.apple.com and I load an iframe with a new url: www.banana.com. In www.banana.com I have 2 comboboxes, When I change the value of the first, the second would be changed. But when I change the value I get a permission denied.

I don't have to copy the value to www.apple.com, so it stays in www.banana.com. What did work was when I opened the frame in a new tab. So my question is: is it a cross domain issue and is there a way to let the comboboxes work?

I work with this line in www.banana.com :

if (window.parent.vulin){
    var docPrefix = window.parent.vulin;
}else{
    var docPrefix = window.parent;
}

and it's the parent.vulin that has the permission problem.

Upvotes: 1

Views: 994

Answers (1)

Dagg Nabbit
Dagg Nabbit

Reputation: 76736

Since you have some amount of control over both domains, you can get around the cross-domain policy using "Cross-Origin Resource Sharing," or CORS.

http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/

The technique involves having the server of the target window send the Access-Control-Allow-Origin HTTP header, and modifying the JavaScript code in the other window slightly to appease IE.

Upvotes: 1

Related Questions