-1

文档完成后如何更改 adsense 代码 TWebbrowser 对象

我尝试更改 div innerhtml,但我看不到 adsense 商业广告如何做到这一点

我的代码块

doc := ie.Document as IHTMLDocument3;
doc2 := ie.Document as IHTMLDocument2;

di := doc.getElementById('aliveli') as IHTMLElement;
s := tstringlist.Create;

s.Add('<script type="text/javascript"><!--');
s.Add('google_ad_client = "pub-8340139631405508";');
s.Add('/* 120x240, oluşturulma 28.10.2009 */');
s.Add('google_ad_slot = "8877320187";');
s.Add('google_ad_width = 468;');
s.Add('google_ad_height = 15;');
s.Add('//-->');
s.Add('</script>');
s.Add('<script type="text/javascript"');
s.Add('src="http://pagead2.googlesyndication.com/pagead/show_ads.js">');
s.Add('</script>');
s.Add('');

doc2.body.innerHTML := s.text;
4

1 回答 1

0

尝试使用di.innerHTML而不是doc2.body.innerHTML.

于 2011-04-13T01:59:38.960 回答