<commit_before>== Description

Problems
1. The ads you include on your website is doing "document.write"
2. They block your webpage from being rendered nicely -- chunks appear as ads comes in

Solutions
1. Drop ads, or change ads provider.
2. Hack "document.write"
3. Refactor your web page, so that ads are at the bottom & all your content renders before them
4. 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
    @@google_ads_cssselector = 'script.googleads' # step 1
    cattr_accessor :google_ads_cssselector        # step 2
    after_filter :postload_google_ads             # step 3
  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 (c) 2009 <NAME>, released under the MIT license<commit_msg>Fix typo in instructions<commit_after>== Description

Problems
1. The ads you include on your website is doing "document.write"
2. They block your webpage from being rendered nicely -- chunks appear as ads comes in

Solutions
1. Drop ads, or change ads provider.
2. Hack "document.write"
3. Refactor your web page, so that ads are at the bottom & all your content renders before them
4. 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 (c) 2009 <NAME>, released under the MIT license
{'fraction_non_alphanumeric': 0.06198003327787022, 'fraction_numerical': 0.012063227953410981, 'mean_word_length': 3.839034205231388, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4684273', 'n_tokens_mistral': 673, 'n_tokens_neox': 634, 'n_words': 320}