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

how to open a link automatically when someone visits my site? thx+rep

Discussion in 'Black Hat SEO' started by carlito, Nov 13, 2011.

  1. carlito

    carlito BANNED BANNED

    Joined:
    Aug 22, 2010
    Messages:
    1,153
    Likes Received:
    326
    Hi

    When a visitor arrives on my site I want to automatically open a new tab launching another website, with google as the refer.

    I used this but doesnt work :

    <body onLoad="window.open('http://www.TheNewUrlTab');">
    </body>

    thanks for your help
     
  2. BlaqReaper

    BlaqReaper Junior Member

    Joined:
    Sep 7, 2011
    Messages:
    130
    Likes Received:
    207
    Code:
    <script type="text/javascript">
    window.open('page.html', ...);
    </script>
    <noscript>
    <p>You do not appear to have JavaScript enabled. Please proceed to the <a href="page.html">next page</a>.</p>
    </noscript>
    That alone should be good enough. Webpage should load Javascript anyways, do not need to do a body on load.
     
    • Thanks Thanks x 1
  3. carlito

    carlito BANNED BANNED

    Joined:
    Aug 22, 2010
    Messages:
    1,153
    Likes Received:
    326
    thanks mate, I tried to replace page.html by google.com but it doesnt open it, please help
     
  4. imperial109

    imperial109 Regular Member

    Joined:
    Jan 19, 2009
    Messages:
    499
    Likes Received:
    361
    Have you tried just a simple HTML redirect?
     
    • Thanks Thanks x 1
  5. carlito

    carlito BANNED BANNED

    Joined:
    Aug 22, 2010
    Messages:
    1,153
    Likes Received:
    326
    in fact I want to keep the first site open, not redirect it
     
  6. ericsson

    ericsson Elite Member Premium Member

    Joined:
    Apr 25, 2009
    Messages:
    2,642
    Likes Received:
    8,132
    Occupation:
    www
    Location:
    Swe
    Home Page:
    search for "iframe" on google man ;)
     
    • Thanks Thanks x 1
  7. carlito

    carlito BANNED BANNED

    Joined:
    Aug 22, 2010
    Messages:
    1,153
    Likes Received:
    326

    I know iframes mate, but I dont want to iframe the 2nd site, I just want it to open at the same time the visitor arrives on the 1st site, in a new window or tab
     
  8. imperial109

    imperial109 Regular Member

    Joined:
    Jan 19, 2009
    Messages:
    499
    Likes Received:
    361
    Code:
    var w = window.open("test.html", "WindowName");
    w.focus();
    I'm not sure if the above works, do like ericsson says and use google.
    (you have to include the onload function in as well)

    Most browsers these days have block automatic opening of new tabs.
    You may want to look into popups or popunders as well. Or use iframe if you just want views.

    GL
     
    • Thanks Thanks x 1
  9. carlito

    carlito BANNED BANNED

    Joined:
    Aug 22, 2010
    Messages:
    1,153
    Likes Received:
    326
    do you think if I put the 2nd site in an iframe in the 1st site, it will count as a "view" ?
    (I need to increase views for the 2nd site that's why I need this code)
     
  10. ericsson

    ericsson Elite Member Premium Member

    Joined:
    Apr 25, 2009
    Messages:
    2,642
    Likes Received:
    8,132
    Occupation:
    www
    Location:
    Swe
    Home Page:
    Do u mean a pop-up kind of? +Your main page loading in background?
     
    • Thanks Thanks x 1
  11. carlito

    carlito BANNED BANNED

    Joined:
    Aug 22, 2010
    Messages:
    1,153
    Likes Received:
    326

    yeah, a pop-up that's what I need, a popup that opens the 2nd site automatically
     
  12. ericsson

    ericsson Elite Member Premium Member

    Joined:
    Apr 25, 2009
    Messages:
    2,642
    Likes Received:
    8,132
    Occupation:
    www
    Location:
    Swe
    Home Page:
    Read this:

    "Creating a JavaScript Popup window

    In order to invoke the popup window at certain instances (like when the page is loading) you need to understand the event handling. For example, if you want to popup a window when the user visits a page, you need to handle the onLoad event of that page. The following section event handling.

    The code below handles the onLoad event and displays a message.

    <body onLoad="javascript: alert('On Load event fired!')">
    The event handler is added in the onLoad event of the <body> tag of the page.

    Similarly, the following code shows the handler for the unload event.

    <body onUnload="javascript: alert('Unload event fired!')">
    Suppose you want to handle the event when the user clicks on a link. The following code shows handling the click on an anchor

    <a href="javascript: alert('Clicked on link!')">Click here!</a>
    "
     
    • Thanks Thanks x 1