2016-06-10 66 views
0

我已经使用Google Swiffy将我的.swf转换为HTML5。但最近有一家媒体机构表示,这些横幅在打开2个新标签时出现问题,而不是仅仅一个。谷歌DCM swiffy转换后的HTML5,双窗口打开错误

这是我总是使用的代码,它具有双选项卡,该代理表示它将重定向到设备上的一个路由:file:/// Users/folder/folder/UNDEFINED,另一个路由到DCM服务器。

<!doctype html> 
    <html> 
     <head> 
     <meta charset="utf-8"> 
     <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
     <meta name="ad.size" content="width=300,height=250"> 
     <script type="text/javascript"> 
     var clickTag = "http://www.google.com"; </script> 
     <title>GOOGLE DCM</title> 

     <script type="text/javascript" src="https://www.gstatic.com/swiffy/v8.0/runtime.js"></script> 

     <script> 
      swiffyobject = { blablabla swiffy code}; 
     </script> 
    <style>html, body {width: 100%; height: 100%}</style> 
    </head> 

    <body style="margin: 0; overflow: hidden"> 
    <a href="javascript:window.open(window.clickTag)" style="width:300px; height:250px; display: block; position: absolute; z-index:999;"> 
    <div id="swiffycontainer" style="width: 300px; height: 250px; border:1px solid black; box-sizing: border-box; "> 
    </div> 
    </a> 

    <script> 
     var stage = new swiffy.Stage(document.getElementById('swiffycontainer'), 
      swiffyobject, {}); 

     stage.start(); 
    </script> 
    </body> 
</html> 

所以,我找到了解决这个问题的this question 而且我也不知道这是一个DCM文件正确的,因为我不知道,如果离开网址可以在没有clickTag的定义

[编辑]该机构现在告诉我,他们没有两个窗口打开的问题,但他们得到的错误,没有发现clicktag ...当然。所以我不知道这里要做什么。

<!doctype html> 
<html> 
    <head> 
    <meta charset="utf-8"> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge"> 

<script src="https://s0.2mdn.net/ads/studio/Enabler.js"> </script> 
    <style> 
     #bg-exit { 
    background-color: rgba(255,255,255,0); 
    cursor: pointer; 
    height: 100%; 
    left: 0px; 
    position: absolute; 
    top: 0px; 
    width: 100%; 
    } 
     </style> 
    <title>GOOGLE DCM</title> 

    <script type="text/javascript" src="https://www.gstatic.com/swiffy/v8.0/runtime.js"></script> 
    <script> 
     swiffyobject = { blablabla swiffy code}; 
    </script> 
    <style>html, body {width: 100%; height: 100%}</style> 
    </head> 

    <body style="margin: 0; overflow: hidden"> 
    <div id="bg-exit"> 
    <div id="swiffycontainer" style="width: 120px; height: 600px; border:1px solid black; box-sizing: border-box; "> 
    </div> 
    </div> 

    <script>  
     var stage = new swiffy.Stage(document.getElementById('swiffycontainer'), 
      swiffyobject, {}); 

     stage.start(); 
    </script> 

    <script> 
    window.onload = function() { 
    if (Enabler.isInitialized()) { 
    enablerInitHandler(); 
    } else { 
    Enabler.addEventListener(studio.events.StudioEvent.INIT, enablerInitHandler); 
    } 
} 

function enablerInitHandler() { 

} 
    function bgExitHandler(e) { 
    Enabler.exit('Background Exit'); 
} 

document.getElementById('bg-exit').addEventListener('click', bgExitHandler, false); 
    </script> 
    </body> 
</html> 

我真的需要尽快解决这个问题,否则我将不得不重做GWD 35个横幅在短短几个小时,因此任何帮助,将不胜感激。提前致谢。

回答