问题描述
您可以将Adsense中的javascript代码放在GWT开头的单个HTML页面中。这样,广告将不会显示在与GTW相同的区域中,而是在GWT代码上方/下方显示。对于广告来说可以。
此示例将横幅放在应用程序上方:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>www.javaoracleblog.com</title>
<script type="text/javascript" language="javascript" src="com.javaoracleblog.aggregator.nocache.js"></script>
</head>
<body>
<script type="text/javascript"..
ADsense code here
</script>
<!-- OPTIONAL: include this if you want history support -->
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
</body>
</html>
为了向Google WT指示可以信任Google adsense的站点,您需要在-whitelist命令行参数中添加一个正则表达式匹配的URL。
请注意,这可能无法解决上述“我为什么转储GWT”文章中描述的问题。
解决方法
有谁知道如何将Google adsense广告放入GWT网络应用程序中?