나는 간단한 제휴 광고 로테이션 자바 스크립트를 만들고 있습니다. 나는 아직 JavaScript에 익숙하지 않고 완전히 이해하지 못하므로 나와 함께 감당해야한다.자바 스크립트; 스크립트 내에서 src를 호출합니까?
Google의 애드 센스는 변수를 설정하는 부분과 스크립트를 가져 오는 부분으로 나뉩니다. 그런 다음 아마존에는 iframe이있어 광고를 얻습니다. 내가하고 싶은 일은 무작위로 하나를 선택하여 내 localhost에 표시 할 1에서 2까지의 난수를 사용하는 것입니다 (나중에 더 커질 것입니다).
<script type="text/javascript"><!--
/* Custom footer */
select = rand(2);
if(select == 1){
google_ad_client = "-----------";
google_ad_slot = "---------";
google_ad_width = ---;
google_ad_height = --;
//get this google
<script ...src="http://pagead2.googlesyndication.com/pagead/show_ads.js
} else {
<iframe src="http://rcm.amazon.com/e/cm?t=------&o=1&p=48&l=ur1&category=amazonhomepage&f=ifr" width="728" height="90" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe>
}
</script>
내부 퍼팅 제안하지만, 페이지에 HTML을 작성하는
document.write("<html>or text</html")
를 사용할 필요가 ... – NickAldwin먼저 무엇을하려고하는지 확인하면 애드 센스 정책이 깨지지 않습니다. 생성 된 스크립트 코드를 수정하면 정책에 위배됩니다. –
정책을 위반 했습니까? 나는 그들의 show_ads.js에서 데이터를 수정하는 것을 의미한다고 생각했다. – Chenelle