1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

T35 Ad deletion

Discussion in 'JavaScript and AJAX' started by thedavinci, May 7, 2009.

  1. thedavinci

    thedavinci New Member

    Joined:
    May 7, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I have a website hosted by T35 and its the free version. I was kind of frustrated with the ads that T35 puts on my website, so I thought up a way to get rid of these ads...Just use Javascript. Place this code below into the head of the document, and add a link to call the document. Look below,
    Code:
    <html>
    <head>
    <script type='text/javascript'>
    function hideAds(){
     var table=(document.getElementsByTagName("table").length)-1;
     void(document.getElementsByTagName("table")[table].innerHTML="");
    }
    </he...
    
    And in the document somewhere, put a link/call to the function...

    Code:
    <a href='javascript:hideAds();'>Hide these ads</a>
    
    And that's all!! This should make the last table element on your web page (which is where T35 places its ads) have no contents, getting rid of those nasty ads...
    Enjoy!
     
  2. thedavinci

    thedavinci New Member

    Joined:
    May 7, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hey, sorry but I do not yet have the permission to edit my posts, I forgot to finish the script tag with a
    Code:
    </script>
    . Sorry!
     
  3. akshits

    akshits New Member

    Joined:
    May 10, 2009
    Messages:
    23
    Likes Received:
    2
    Trophy Points:
    0
    Hello,

    I don't understand what does you code do and I've specially join T35 to help you out. Your website tries to remove ads from the page, if I'm not mistaken. As per what I know by registering into the new T35 account, the T35 website makes a div named "t35ad". Below is a code which may help you.

    Code:
    
    <script>
    
    function $(id) { return document.getElementById(id); }
    window.onLoad = function() { $("t35ad").style.display="none"; }
    document.onLoad = function() { $("t35ad").style.display="none"; }
    
    </script>
    
    
    Thus I assure you 99.9% sure that the code shall work !!

    Regards
     
  4. Handers

    Handers New Member

    Joined:
    Jun 11, 2009
    Messages:
    2
    Likes Received:
    1
    Trophy Points:
    0
    I found this website with google but those solutions are not 100% perfect, not in all browsers at least :)

    I dont know how to use akshits code but it's not really working for me....

    thedavinci's code (lol sounds funny :P) works but only in firefox.

    I have come up with another solution which does not delete the code but makes it invisible. It does that by putting it into a 0px by 0px div and throw it into a corner behind your website. Here's the code:

    Code:
    <div style="font-size:0px; position:absolute; width:0px; height:0px; color:#000000; z-index:-1; overflow:hidden;"><xmp></body></xmp></div>
    <script type='text/javascript'>
    document.write('</bo');
    document.write('dy>');
    </script>
    </html>
     
    SaswatPadhi likes this.
  5. Handers

    Handers New Member

    Joined:
    Jun 11, 2009
    Messages:
    2
    Likes Received:
    1
    Trophy Points:
    0
    I see I forgot to metion how to use this code....

    You replace your end body tag:

    Code:
    </body>
    with

    Code:
    <div style="font-size:0px; position:absolute; width:0px; height:0px; color:#000000; z-index:-1; overflow:hidden;"><xmp></body></xmp></div>
    <script type='text/javascript'>
    document.write('</bo');
    document.write('dy>');
    </script>
     

Share This Page