我正在使用Google DFP广告管理系统中的一些新功能,并且无法单独添加一个添加内容.我可以刷新页面上的所有广告,但我不能单独刷新一个.
我一直在尝试以下代码来获得一个添加刷新而没有运气:
var slot1 = googletag.display('/6900315/myad2', [300, 250], 'div-2');
googletag.pubads().refresh([slot1]);
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激!
完整来源:
<script type='text/javascript'>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function () {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>
script type='text/javascript'>
googletag.cmd.push(function () {
googletag.pubads().enableAsyncRendering();
googletag.defineSlot("/69003153/myad1", [728, 90], "div-1").addService (googletag.pubads());
googletag.defineSlot("/69003153/myad2", [300, 250], "div-2").addService (googletag.pubads());
googletag.enableServices();
}); …Run Code Online (Sandbox Code Playgroud) 我正在使用jquery调用webmethod,webmethod返回一大块HTML,然后将其加载到div中.
它工作正常,直到一定大小的块然后它根本不起作用.如果html的块大于70KB,它似乎停止工作.
我正在使用的jQuery是:
$(".letterBtn").live("click", function() {
$("#divLoading").html('<img src="images/loading.gif" alt="Loading..." />');
$.ajax({
type: "POST",
url: "Default.aspx/Search",
data: "{sFor:" + "'" + this.id + "'" + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
$("#divOut").html(msg.d);
$("#divLoading").html('');
}
});
});
Run Code Online (Sandbox Code Playgroud)
网络方法与此类似
<WebMethod()> _ Public Shared Function Search(ByVal sFor As String) As String
Dim htmlString As String = "<div>some html</div>"
Return htmlString
End Function
Run Code Online (Sandbox Code Playgroud)
我似乎无法弄清楚为什么它不适用于较大的HTML块.有人有什么想法吗?谢谢!