Du befindest Dich im Archiv vom ABAKUS Online Marketing Forum. Hier kannst Du Dich für das Forum mit den aktuellen Beiträgen registrieren.

Adsense-JS-Code bei onLoad laden

Alles zum Thema Google Adsense.
Neues Thema Antworten
Timmeee
PostRank 1
PostRank 1
Beiträge: 3
Registriert: 04.07.2007, 22:25

Beitrag von Timmeee » 04.07.2007, 22:33

Hallo,
Die Adsense-Werbeeinblendungen verzögern leider den Seitenaufbau.
Jetzt ist meine Vorstellung, dass ich doch zuerst die Seite lade und dann den Adsense-Code in meine Seite mittels Javascript schreibe.
Ich habe es versucht, komme damit aber nicht ganz klar.
Weiß jemand, wie man das realisieren könnte?
Wäre das ein Verstoß gegen die Google-Adsense-Richtlinien?

Das habe ich bereits probiert:

Code: Alles auswählen

function onLoadFkt()
{
//document.getElementById('ads').innerHTML="Hallo!";
var script1 = document.createElement("script");
script1.setAttribute('type','text/javascript');
script1.setAttribute('src','google1.js'); // Hier stehen die ganzen Google-Variablen drinne! 
script1.text='';
document.getElementById("ads").appendChild(script1);

var script2 = document.createElement("script");
script2.setAttribute('type','text/javascript');
script2.setAttribute('src','http://pagead2.googlesyndication.com/pagead/show_ads.js');
document.getElementById("ads").appendChild(script2);

var iframe = document.createElement("iframe");
iframe.setAttribute('name','google_ads_frame');
iframe.setAttribute('src','http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-2578266285326781&dt=1183580367734&lmt=1183580366&format=120x240_as&output=html&correlator=1183580367734&url=http%3A%2F%2Ftest.thimo-klueser.de%2Findex.php&color_bg=939192&color_text=000000&color_link=000000&color_url=008000&color_border=939192&ad_type=text&ref=http%3A%2F%2Ftest.thimo-klueser.de%2Findex.php%3Fforum&cc=38&flash=9&u_h=1200&u_w=1600&u_ah=1110&u_aw=1600&u_cd=32&u_tz=120&u_his=11&u_java=true&u_nplug=25&u_nmime=73');
iframe.setAttribute('marginwidth','0');
iframe.setAttribute('marginheight','0');
iframe.setAttribute('vspace','0');
iframe.setAttribute('hspace','0');
iframe.setAttribute('allowtransparency','true');
iframe.setAttribute('frameborder','0');
iframe.setAttribute('height','240');
iframe.setAttribute('scrolling','no');
iframe.setAttribute('width','120');
document.getElementById("ads").appendChild(iframe);
}
Es funktioniert einfach nicht. Könnt ihr mir bitte weiterhelfen.

Grüße
Timmeee

Antworten
  • Vergleichbare Themen
    Antworten
    Zugriffe
    Letzter Beitrag