After consulting and confirming with the Google AdSense team, the tutorial of helping the customer House (www.bkjia.com) allows the webmaster to use js to call Google AdSense ads. The following describes how to call it:
First, write a js file in notepad and paste the code of the google advertisement into it: Find and replace all the "characters and replace them \", search for all the/characters and replace them \/.
Add document. writeln ("Add at the end") at the beginning of each line ");
In this way, the js file for google ads will be ready.
It is recommended that you use the HTML/JS Conversion Tool to directly convert the GG advertisement code to the JS method:Http://tool.bkjia.com/tool/html_js.asp
Then upload your google ad js file to a folder on your website. In this way, google ads can be used by calling js files.
The following is the js Code of a website (Google_Liehuo.js ):
Reference content is as follows: Document. writeln ("<script type = \" text \/javascript \ "> <! -"); Document. writeln ("google_ad_client = \" pub -********************\";"); // modify the asterisks in front of your publisher code Document. writeln ("\/* 728 × 90, created in 09-5-4 *\/"); Document. writeln ("google_ad_slot = \" *************** \ ";"); // modify the asterisks on the front of your actual code. Document. writeln ("google_ad_width = 728 ;"); Document. writeln ("google_ad_height = 90 ;"); Document. writeln ("\/-> "); Document. writeln ("<\/script> "); Document. writeln ("<script type = \" text \/javascript \""); Document. writeln ("src = \" http: \// pagead2.googlesyndication.com \/pagead \/show_ads.js \ "> "); Document. writeln ("<\/script> "); |
- 2 pages in total:
- Previous Page
- 1
- 2
- Next Page