/    Sign up×
Community /Pin to ProfileBookmark

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 [URL=”http://img.ugu.pl/advert.js”]like this[/URL]. 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?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@aj_nscFeb 19.2010 — 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).
×

Success!

Help @n0e spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...