1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Exit redirect

Discussion in 'Black Hat SEO' started by domainmadness, Jul 11, 2013.

  1. domainmadness

    domainmadness Senior Member

    Joined:
    Jun 22, 2011
    Messages:
    1,036
    Likes Received:
    334
    Is there any good working exit redirect plugins? Not looking for exit popup, just redirect from current page to another one when mouse is leaving.
     
  2. domainmadness

    domainmadness Senior Member

    Joined:
    Jun 22, 2011
    Messages:
    1,036
    Likes Received:
    334
    Gonna bump this once if anybody happens to have any info!
     
  3. thedorf

    thedorf Senior Member

    Joined:
    Oct 1, 2008
    Messages:
    1,193
    Likes Received:
    700
    Occupation:
    what? I gotta have a job?
    Location:
    BHW - Where else?
    Here is the javascript for the mouse leaving the active browser area - just change where it says alert("left window"); to do a Javascript redirect as:

    Code:
    window.location = "http://www.google.com/"
    Code:
    <script type="text/javascript">
    function addEvent(obj, evt, fn) {
        if (obj.addEventListener) {
            obj.addEventListener(evt, fn, false);
        }
        else if (obj.attachEvent) {
            obj.attachEvent("on" + evt, fn);
        }
    }
    addEvent(window,"load",function(e) {
        addEvent(document, "mouseout", function(e) {
            e = e ? e : window.event;
            var from = e.relatedTarget || e.toElement;
            if (!from || from.nodeName == "HTML") {
                // stop your drag event here
                // for now we can just use an alert
                alert("left window");
            }
        });
    });
    </script>
     
    • Thanks Thanks x 6
  4. ksj55

    ksj55 Newbie

    Joined:
    Nov 8, 2011
    Messages:
    32
    Likes Received:
    0
    Where do you place that code? sounds useful.

    Thanks,
     
    Last edited: Jul 25, 2013
  5. lloughry

    lloughry Regular Member

    Joined:
    Jan 23, 2013
    Messages:
    337
    Likes Received:
    100
    so in firefox this will automatically redirect to the target page, in chrome the visitor has to hit ok to be redirected.

    What do I enter in alert to have a box pop up with a message that redirects to a site? I tried a few things and now there is no pop up or redirect.
    Currently I have:
    Code:
      alert("message" window.location = "http://www.url.com");
     
  6. dinkish

    dinkish Power Member

    Joined:
    Apr 19, 2013
    Messages:
    689
    Likes Received:
    159
    Confimation window (Ok \ Cancel):
    Code:
    if (window.confirm('Blah blah blah, click ok to proceed')) {
            window.location.href='http://www.url.com/';
        }
    
    Dialog box ("OK"):

    Code:
    if (window.alert('You will proceed to our updated site.')) {
            window.location.href='http://www.url.com/';
        }
    
    I haven't tested this, but that's basically what you'll need to get going in the right direction if a copy paste job won't do.
     
    • Thanks Thanks x 1
  7. lloughry

    lloughry Regular Member

    Joined:
    Jan 23, 2013
    Messages:
    337
    Likes Received:
    100
    this is the first time I have played with java. copy/paste didn't work and the few things I could think to try as variations did not get me there. I will look at it again in the morning. Thanks for the help.
     
  8. dinkish

    dinkish Power Member

    Joined:
    Apr 19, 2013
    Messages:
    689
    Likes Received:
    159
    Took a look and tested it. This is the copy\paste job. Put it in the head or body tags.
    Code:
    <script type="text/javascript">
        window.alert('You will proceed to our updated site.')
        window.location.href='http://www.google.com/';
    </script>
    
    Or prompt box:
    Code:
    <script type="text/javascript">
    window.confirm('Blah blah blah, click ok to proceed'
        window.location.href='http://www.google.com/';
    </script>
    
     
  9. dinkish

    dinkish Power Member

    Joined:
    Apr 19, 2013
    Messages:
    689
    Likes Received:
    159
    You could trigger it with a onclick event by making it into a function pretty easily if you didn't want it on page load.
     
  10. thedorf

    thedorf Senior Member

    Joined:
    Oct 1, 2008
    Messages:
    1,193
    Likes Received:
    700
    Occupation:
    what? I gotta have a job?
    Location:
    BHW - Where else?
    No no you just want to replace the entire alert statement with the entire window.location statement - you are combining them.

    Look at the functionality and source code at http://www.marketingillusionist.com/test.html
     
    • Thanks Thanks x 2
    Last edited: Sep 1, 2013
  11. M1ndfluX

    M1ndfluX Senior Member

    Joined:
    Dec 23, 2009
    Messages:
    1,119
    Likes Received:
    868
    Location:
    031010
    Interesting advice, but i would like to know if these tactics will hurt my ranks. Guess not, just asking...
     
  12. thedorf

    thedorf Senior Member

    Joined:
    Oct 1, 2008
    Messages:
    1,193
    Likes Received:
    700
    Occupation:
    what? I gotta have a job?
    Location:
    BHW - Where else?
    @M1ndfluX I do not see why this would hurt you unless a manual review decided they did not like it. I do not know if a robot would trigger this event or not, but I am thinking not.

    Anyway, @EveryoneElse

    Here is the javascript you should just copy / paste:

    Code:
    <script type="text/javascript">
    function addEvent(obj, evt, fn) {
        if (obj.addEventListener) {
            obj.addEventListener(evt, fn, false);
        }
        else if (obj.attachEvent) {
            obj.attachEvent("on" + evt, fn);
        }
    }
    addEvent(window,"load",function(e) {
        addEvent(document, "mouseout", function(e) {
            e = e ? e : window.event;
            var from = e.relatedTarget || e.toElement;
            if (!from || from.nodeName == "HTML") {
                // stop your drag event here
                // for now we can just use an alert
                //alert("left window");
    		window.location = "http://www.google.com/"
            }
        });
    });
    </script>
    Goodbye - just mouseout the window...
    
    This also has the side-effect of triggering itself if someone right clicks on the page - making it difficult to get to the source code!
     
    • Thanks Thanks x 3
    Last edited: Sep 2, 2013
  13. dinkish

    dinkish Power Member

    Joined:
    Apr 19, 2013
    Messages:
    689
    Likes Received:
    159
    I think the last line needs a semi-colon:

    Code:
    window.location = "http://www.google.com/";
    
    I misread the thread some how and didn't see exit redirect. Sorry for the confusion on my end.
     
  14. ksj55

    ksj55 Newbie

    Joined:
    Nov 8, 2011
    Messages:
    32
    Likes Received:
    0
    Unless it's a wp plug in, I'm clueless. Where does one insert this (I need mentally slow-like details) lol
     
  15. dinkish

    dinkish Power Member

    Joined:
    Apr 19, 2013
    Messages:
    689
    Likes Received:
    159
    Anywhere in between the HTML tags pretty much. I keep mine in above the </head> tag.
     
  16. lloughry

    lloughry Regular Member

    Joined:
    Jan 23, 2013
    Messages:
    337
    Likes Received:
    100
    this does what I was looking for, thanks for the update.
     
    • Thanks Thanks x 1
  17. manolo12399

    manolo12399 Senior Member

    Joined:
    Jan 3, 2009
    Messages:
    818
    Likes Received:
    161
    woul be perfect if wouldnt trigger also on the scroll bar
     
  18. manolo12399

    manolo12399 Senior Member

    Joined:
    Jan 3, 2009
    Messages:
    818
    Likes Received:
    161
    dont want to resume this old thread, but there is a method to stop firing the redirect when just using the scroll-bar? would be nice to have redirect only when the mouse exit up or down from the page and if he close the page or click the back button
     
  19. Repulsor

    Repulsor Power Member

    Joined:
    Jun 11, 2013
    Messages:
    708
    Likes Received:
    267
    Location:
    PHP Scripting ;)
    Go through my threads, I posted a script which hacks the back button. Redirect the user when they go out of your site hitting the back button.
     
    • Thanks Thanks x 1
  20. manolo12399

    manolo12399 Senior Member

    Joined:
    Jan 3, 2009
    Messages:
    818
    Likes Received:
    161
    yes work great, looking to integrate with this, but without firing on the scroll bar


    thanks a lot


    may be something to do with CSS?
     
    Last edited: May 31, 2015