File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes How to detect page redirection from iframe and prevent it Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to detect page redirection from iframe and prevent it" Watch "How to detect page redirection from iframe and prevent it" New topic
Author

How to detect page redirection from iframe and prevent it

utsav gupta
Ranch Hand

Joined: Mar 19, 2009
Posts: 57
Hi
I'm trying to create a search engine.
But some of the webpages that are shown as results redirect my search page to their own website.
How can i detect and prevent it.

I was thinkking on these lines.

There is a function windows.location which redirects the page.(hopefully this is the only one). If I can findout who is caling this function. Then may be I can prevent it. Is it possible to do so?.

Or if you have a better sugesstion please let me know.


Thanks and Regards
Utsav.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
If it is on another domain, you can not do anything.

Eric
utsav gupta
Ranch Hand

Joined: Mar 19, 2009
Posts: 57
Eric Pascarello wrote:If it is on another domain, you can not do anything.

Eric


Hi Eric

If i am correct search engines like google are able to detect page redirection and hence ban those websites. How do they do it?

Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
They would not do it with JavaScript

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to detect page redirection from iframe and prevent it