Web Analytics Made Easy -
StatCounter Why wont Google ads show? - CodingForum

Announcement

Collapse
No announcement yet.

Why wont Google ads show?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why wont Google ads show?

    Why wont Google ads show in this code, well they will but it puts the ad top of screen not in the ad box. My Google ad is in the ad.php folder.

    Code:
    <script language="javascript">
          function myFunction()
          {
            document.getElementById("advertonce").style.display='none';
          }
    </script>
    
    <script type="text/javascript">
    function createCookie(name,value,days) {
    if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
    }
    
    function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
    }
    
    function eraseCookie(name) {
    createCookie(name,"",-1);
    }
    
    
    </script>

    Code:
    <script type="text/javascript">
    if(!readCookie('visitedPreviously')){
    document.write(' <div id="advertonce"><a href="javascript:myFunction()"title="Close" class="closes">X</a><?php include("ad.php"); ?></div>');
    createCookie('visitedPreviously', 'visitedPreviously', 365);   // 365 days persistence
    }
    
    //eraseCookie('visitedPreviously');  // FOR TEST PURPOSES
    
    </script>

    Code:
    #advertonce {
    background-color: #ffffff;
    border:1px solid red;
    bottom: 30px;
    display: inline-block;
    left: 0;
    margin: auto;
    padding: 5px 0px 1px 5px;
    position: absolute;
    right: 0;
    width:478px;
    }
     
    .closes {
    background: #3b81de;
    border-radius: 12px;
    box-shadow: 1px 1px 3px #000;
    color: #fff;
    font-weight: bold;
    line-height: 25px;
    -moz-border-radius: 12px;
    -moz-box-shadow: 1px 1px 3px #000;
    position: absolute;
    right: -12px;
    text-align: center;
    text-decoration: none;
    top: -10px;
    -webkit-border-radius: 12px;
    -webkit-box-shadow: 1px 1px 3px #000;
    width: 24px;
    }
    
    .closes:hover {
    background:#204a84;
    }
Working...
X