-1

How can i change adsense code TWebbrowser object after document complete

i try change div innerhtml but i cant my see adsense commercial how can do this

my code block

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;
Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770

1 Answers1

0

Try using di.innerHTML instead of doc2.body.innerHTML.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • in the webbrowser code successuflly changed but is have javascript and not reloaded i cant see adsense adwertising – Kadir Saracoglu Apr 14 '11 at 04:32
  • Then you will likely have to download the raw HTML yourself, modify it as needed, then load it into the WebBrowser via one of its `IPersist...` interfaces. – Remy Lebeau Apr 19 '11 at 19:39