Monday, February 9, 2009

Removing Ads from Free Web Hosting

About an hour ago, I decided that I wanted to build a website in addition to this blog. I quickly scourged Google for free web hosts, and found only a few that offered "no-ads" but they all had some sort of catch or queue. Being impatient I reluctantly chose a site that offered free web hosting, but put its own Google Adsense ads on your page. I wouldn't have minded, but I wasn't given control over the ads' placements or color schemes and they really looked hideous. I realized I would have to figure out a way to remedy the situation myself.

After uploading a sample webpage, I navigated and veiwed its source. After re-uploading, a few slightly modified versions of that page I noticed that the hosting service was appending the code for all of its ads right after the first <body> tag. I experimented with comments, trying things like <body <!-- but whenever I placed the last > the ad code would escape the comment.

I decided to bend the rules of HTML. To solve the problem I made the first <body <!-- tag and then another <body> after it. The ad code generated by the HTML parser ended the comment and my second body tag worked perfectly. Wa-lah, no ads. Mark one loss for HTML parsers. Mark one win for me.

No comments:

Post a Comment

 
My Zimbio
Top Stories Computer Blogs - BlogCatalog Blog Directory