Unsafe JavaScript attempt to access frame with URL
问题 I am getting the below error when i try to set a hash value to the parent url from iframe which contains another domain url: Unsafe JavaScript attempt to access frame with URL "URL1" from frame with URL "URL2". Domains, protocols and ports must match. How can I fix this problem? 回答1: From a child document of different origin you are not allowed access to the top window's location.hash property, but you are allowed to set the location property itself. This means that given that the top windows