Results 1 to 2 of 2

Thread: Remove annoying JS ad

  1. #1
    Join Date
    Feb 2010

    Remove annoying JS ad

    Hi all,

    I'm new to JS and I was wondering how to achieve the following: I need to remove an annoying ad which my hosting provider adds to the page, as a link to js script. It looks like this. I'm thinking that I could add another script which would hide layers/iframes which the first one added. Problem is that they don't have any IDs. Any ideas?

  2. #2
    Join Date
    Dec 2005
    Use Firefox and the webdeveloper toolbar add on to "View generated source" and then find out exactly where this div is in the DOM. Then just using DOM traversing techniques to get to that element and remove it. This must be done by a script which uses a setInterval (check every 10-100ms to see if the ad node is present) or setTimeout (run a function after a couple of seconds) after pageload to make sure the script which the host adds to the page has enough time to load and create the add.

    HOWEVER, it's very very very very likely that doing this would constitute a violation of your hosts TOS and if you do this you will eventually get reprimanded/removed from their service.

    If this is a free host, then cough up the dough if you want a page without advertising, if this is a paid host, then get a new host, they shouldn't be putting advertising on your site anyway so tell them to stop or you'll switch hosts (that might allow them to make an exception in your case) or just plain switch hosts (I know a couple of fantastic ones in terms and price AND service, if you're interested).
    I've switched careers...
    I'm NO LONGER a scientist,
    but now a web developer...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center