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

Auto click script

Discussion in 'General Scripting Chat' started by total.load, Mar 16, 2012.

  1. total.load

    total.load Newbie

    Joined:
    Jan 24, 2012
    Messages:
    22
    Likes Received:
    2
    I've found this script:
    PHP:
    <a id="abanner"><img src="#" id="ibanner" alt="" /></a>

    <
    script type="text/javascript">
    //fill in the information here:
    bannerCreate("yourimage","yourlink");

    function 
    openWindow(linkLocation)
    {
        
    window.open(linkLocation,"");
        
    }

    function 
    bannerCreate(imageSrc,linkLocation)
    {
        var 
    a=document.getElementById("abanner");
        var 
    i=document.getElementById("ibanner");
        
    a.href="javascript: openWindow('"+linkLocation+"')";
        
    i.src=imageSrc;
    }

    </script>
    And it says that will auto click (and open in new window).
    I don't know much about javascript.What I have to add so it 'll become functional with my site,and where I have to upload it(i have an wordpress site)?
     
  2. Question

    Question Registered Member

    Joined:
    Aug 14, 2011
    Messages:
    51
    Likes Received:
    32
    This script don't auto clicks, it creates banner with image "yourimage" and opens new window with "yourlink" when you click the link. You can add <script>...</script> to header.php file of your wordpress theme. and <a>...</a> in place where you want to insert banner.