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

OnClick to new URL?

Discussion in 'HTML & JavaScript' started by skibio, Sep 12, 2012.

  1. skibio

    skibio Registered Member

    Joined:
    Apr 27, 2008
    Messages:
    94
    Likes Received:
    4
    Hi everyone

    I have my personal blog and i want when visitor click the first time in my blog be redirected to another blog/website can u give me hint

    any idea is appreciated .

    Tnx
     
  2. blackhacik

    blackhacik Junior Member

    Joined:
    Nov 25, 2010
    Messages:
    108
    Likes Received:
    8
    Home Page:
    maye use cookies and javascript.
     
  3. edgaro160

    edgaro160 Junior Member

    Joined:
    Dec 17, 2012
    Messages:
    130
    Likes Received:
    141
    IDK ABOUT blogs but if you can use target="_blank" on the link that will open a new tab with the link,
    this is for html idk if it applies for blog
    OR byw dont you just put the link in your blog ?
     
  4. Nitros

    Nitros Power Member

    Joined:
    Jan 30, 2009
    Messages:
    573
    Likes Received:
    295
    Code:
    <script type="text/javascript"> window.onclick = function() { setTimeout("window.location.href= 'http://website.com'",2000); } </script>
     
  5. firescape

    firescape Newbie

    Joined:
    Feb 1, 2013
    Messages:
    10
    Likes Received:
    0
    You can insert javascript in the onclick statment just as you would inside script tags.

    onclick="javascript:location.replace('yourwebsitelink');"