This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Wed Mar 18 18:13:39 -0700 2009 | |
| |
README.rdoc | Thu Mar 19 00:30:04 -0700 2009 | |
| |
Rakefile | Wed Mar 18 18:13:39 -0700 2009 | |
| |
init.rb | Wed Mar 18 18:13:39 -0700 2009 | |
| |
install.rb | Wed Mar 18 18:13:39 -0700 2009 | |
| |
lib/ | Wed Mar 18 18:13:39 -0700 2009 | |
| |
tasks/ | Wed Mar 18 18:13:39 -0700 2009 | |
| |
test/ | Wed Mar 18 18:13:39 -0700 2009 | |
| |
uninstall.rb | Wed Mar 18 18:13:39 -0700 2009 |
README.rdoc
Description
Problems
- The ads you include on your website is doing "document.write"
- They block your webpage from being rendered nicely — chunks appear as ads comes in
Solutions
- Drop ads, or change ads provider.
- Hack "document.write"
- Refactor your web page, so that ads are at the bottom & all your content renders before them
- Use postload_google_ads plugin to do (3) for you.
Requirements
In this implementation, jQuery, Hpricot & Rails are required.
Getting started
Make sure you give your <script> tags for google something identifiable, e.g. <script class="googleads"> Then configure the necessary controller:
class ApplicationController < ActionController::Base
include PostloadGoogleAds # step 1
@@google_ads_cssselector = 'script.googleads' # step 2
cattr_accessor :google_ads_cssselector # step 3
after_filter :postload_google_ads # step 4
end
Restart your Rails server and see
Tips
To prevent ads from shifting your layout, it is best to wrap your google ads <script> tag in something (e.g. div) and give it an explicit height width.
Copyright © 2009 Chew Choon Keat, released under the MIT license







