私は、現時点ではこれを持っているページでは...いくつかのAdServerコード怠惰な負荷に`document.write`を傍受する方法はありますか?
をしようとしています:私は、その後通過し、上にある必要があり、広告のすべてを引き出す
<div class="ad">
<span>pos_1</span>
</div>
ページ、彼らのJavaScriptを呼び出すには、ファイルが含まれており、それが私にこの素敵な混乱を与える:
function do_ad(pos){
switch(pos){
case 'pos_1':
document.write('first ad text');
document.write('first ad more text');
//and so on for many many lines
break;
case 'pos_2':
document.write('second ad text');
document.write('second ad more text');
//and so on for many many lines
break;
}
}
私はその後、document.write
広告呼び出しの結果とスパンを交換したいです。
ページに書き込まれた文字列を返す方法はありますか?
の可能重複 - (http://stackoverflow.com/questions/1536970/javascript-controlling-the-insertion-point-for-document-write)はJavaScriptのdocument.writeの挿入ポイントを制御] –