1

This seems like a basic question, but from the research I've gathered so far it seems like the Same-Origin policy should prevent me from doing this.

I have two domains:

sub1.domain.org/test contains an iframe with its src pointing to the other: sub2.domain.org

On sub2:

//triggers a cross-domain security error
alert(window.parent.location.href);

//executes just fine on FF, IE, Chrome, and Safari.
window.parent.location.href = new_url; 

So it appears I'm allowed to write to the parent window's URL, but I'm not allowed to read it. Is that really the standard? I just need to know why this is working as it does.

Robbert
  • 6,481
  • 5
  • 35
  • 61
user3923442
  • 41
  • 1
  • 1
  • 3

0 Answers0