Yesterday's own station to put GG AD, but the site is all static page, but I want to casually update the GG ad so think of using JS file Import method, also can use. php file Import Way, the following is about my method:
First of all, directly in the source code put GG ad a lot of people put this:
<script type= "Text/javascript" ><!--
Google_ad_client = "pub-6219414158063594";
/* 468x15, founded in 08-3-10 * *
Google_ad_slot = "2571270205";
Google_ad_width = 368;
Google_ad_height = 20;
-->
</script>
<script type= "Text/javascript"
src= "Http://pagead2.googlesyndication.com/pagead/show_ads.js" >
</script>
This has a very big inconvenience is that I replace inconvenient, the following we take a look at JS. File Import form.
I put <script src= '/gg_ad/gg.js ' in the source code of the Web page ></script>
In the gg.js file to put the above code, but because it is a JS file so we have to go to the unnecessary symbols, the code is as follows:
Google_ad_client = "pub-6219414158063594";
Google_ad_slot = "7794600866";
Google_ad_width = 234;
Google_ad_height = 60;
Google_cpa_choice = "";
document.write (' <script type= "Text/javascript" src= "Http://pagead2.googlesyndication.com/pagead/show_ads.js" ></script> ');
There is also a JS into the guide PHP file, see example:
<script src= ' js.php ' is written in js.php,
document.write (' google_ad_client = ' pub-6219414158063594 '; '); There are no more words here than others.
Note: Original www.111cn.net, reprint please indicate the place.