Wednesday, 15 September 2010

javascript - IFrame get parameters from parent url on different domain -


It seems that this is not possible by default because I get an error with the original x with a frame with the original Stops from reaching one frame I know that this is due to security, but I want to allow affiliates to integrate their iframe. Iframe domain is on mysubdomain.mysite.com and contains a search box. After the user has done the search, it has been redirected to page partners-domain-search-results.com. Search results are also on the domain mysubdomain.mysite.com and I want to read the parameters from URL (hash and query string parameters) I am, but I can not because I can not read the parent URL parameter (partners - contact domain-search-results.com).

You should be able to use top.location from the subdomain. To read the original URL of the partners to MySite com-domain-containing-search-results.com:

For example, embedded in partners and partners in MySubdomain.mysite.com embedded -domain- Containing-search-results.com?hello=true#blabla You must be able to run:

  top.location .hash & gt; "# Blabla" top.location.search & gt; Note: You can not modify the location object of other domains, or you will see: 

Unwanted Security: Original: With a frame being blocked "" by reaching one frame with the original. Protocol, domains and ports should match.


No comments:

Post a Comment