Jquery gets the contents of the iframe

  • 2020-03-29 23:47:38
  • OfStack



When calling an IFRAME across domains, access is denied. An untested solution was found on the web
      A review of the data shows that, by default, the browser prohibits scripts from accessing across domains, unless there is a necessary trust relationship between these domains.

      It is easy to find the problem, which can reduce the security level of the browser, but it is definitely bad for the user.

      So we need to add some js to the page
    document.domain = "xxx.net";
      Manually set the domain name of the child page and the parent page to the same, the problem can be solved.

Related articles: