简体   繁体   中英

Act on event of change of iframe url

Okay, so I read and I read, but I couldn't figure out what to do with it.

My situation is this : A blog is hosted inside my university and is accessible just inside the university. That bums me out because I want to check it when I am at home. Trust me, if this goes through I will report it to the proper authorities in the university. So what I did was this: I uploaded a PHP script in my webspace in the university which used the webspace offering server(inside the univ domain) to grab the HTML in the blog, and output it to my homepage inside an iframe.

The problem : Whenever I click on any of the links inside the iframe, it redirects to the original page in the blog and so I am not able to read it.

I started by reading up on addEventListener. Then I thought about outputting the output of the PHP file directly into this page using document.write(). (But that would cause my original js to disappear, and I don't want that). I saw the multitude of posts announcing the forbidden nature of cross-domain JS access. So the idea of fetching the URL after I click on the link on the blog inside the ifram and get the 403 forbidden, and then loading the iframe again is gone too.

Any suggestion are welcome.

Cheers, AJRocker

我认为这种重定向的原因是,每个链接都具有带有“ _top”值的目标属性,以防止这种注入到iframe中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM