使用JavaScript为Google Adsense横幅打开窗口

时间:2013-03-16 06:21:13

标签: javascript adsense window.open

我想编码以便使用Javascript for Google Adsense横幅打开窗口。但我不知道怎么做。我告诉你我的代码:

    <div id="ad"> 
    <div> 
        <script type="text/javascript" language="JavaScript">
        <!-- function DoHideIFRAME(tid1,tid2,tid3) {
                document.getElementById(tid1).style.display = "none"; 
                document.getElementById(tid2).style.display = "none"; 
                document.getElementById(tid3).style.display = ""; 
            } //-->
        </script>
        <div id="postads"> 
            <a border="0" id="hideiframe" onclick="DoHideIFRAME('hideiframe','postads1','viewiframe');"> 
            <img src="img/adclose.png" width="5" height="5"> 
            </a> 
        </div> 
        <br/><br/> 
        <div id="postads1"> <script type="text/javascript">
            <!-- google_ad_client = "ca-pub-xxxxxxxxxxxx"; /* Adversitement */ google_ad_slot = "xxxxxxxxx"; google_ad_width = 300; google_ad_height = 250; //--> </script> 
            <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> 
        </div> 
    </div>
    <div> 
        <script type="text/javascript" language="JavaScript">
            <!-- function DoViewIFRAME(tid1,tid2,tid3) { 
                    window.open (); 
                    document.getElementById(tid1).style.display = "none"; 
                    document.getElementById(tid2).style.display = ""; 
                    document.getElementById(tid3).style.display = ""; 
                } 
                function DoHideIFRAME(tid1,tid2,tid3) { 
                    document.getElementById(tid1).style.display = "none"; 
                    document.getElementById(tid2).style.display = "none"; 
                    document.getElementById(tid3).style.display = ""; 
                } //-->
        </script> 
    </div> 
</div> 

我添加了以下代码: 来自window.open ();的函数DoViewIFRAME(tid1,tid2,tid3)

但它不起作用。为什么?有什么问题?

0 个答案:

没有答案