gpt4 book ai didi

javascript - DoubleClick Floodlight onClick

转载 作者:行者123 更新时间:2023-11-28 06:03:50 25 4
gpt4 key购买 nike

我正在尝试将以下代码转换为“onClick”事件以添加到 HREF 标记。我的 JavaScript 经验有限,但我知道这是可以做到的。任何形式的指导将不胜感激。

<script type="text/javascript">
var axel = Math.random() + "";
var a = axel * 10000000000000;
document.write('<iframe src="https://4607507.fls.doubleclick.net/activityi;src=4607507;type=ustac0;cat=lwt16db;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord=' + a + '?" width="1" height="1" frameborder="0" style="display:none"></iframe>');
</script>
<noscript>
<iframe src="https://4607507.fls.doubleclick.net/activityi;src=4607507;type=ustac0;cat=lwt16db;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;ord=1?" width="1" height="1" frameborder="0" style="display:none"></iframe>
</noscript>

最佳答案

Floodlight documentation 解释了如何完成这样的事情:

<head>
<script type="text/javascript" id="DoubleClickFloodlightTag">
//<![CDATA[
function FLOOD1(type, cat, u1) {
var axel = Math.random()+"";
var a = axel * 10000000000000000;
var flDiv=document.body.appendChild(document.createElement("div"));
flDiv.setAttribute("id","DCLK_FLDiv1");
flDiv.style.position="absolute";
flDiv.style.top="0";
flDiv.style.left="0";
flDiv.style.width="1px";
flDiv.style.height="1px";
flDiv.style.display="none";
flDiv.innerHTML='<iframe id="DCLK_FLIframe1" src="http://12345678.fls.doubleclick.net/activityi;src=12345678;type=' + type + ';cat=' + cat + ';u1=' + u1 + ';ord=' + a + '?" width="1" height="1" frameborder="0"><\/iframe>';
}
//]]>
</script>
</head>

<body>
<!-- This is an example of a "onclick" call on a anchor tag -->
<a href="http://address_of_page_to_load_or_file_to_download" onclick="FLOOD1('testtype', 'testcat', 'testu1');" target="_blank">Click here to test the tag</a>
</body>

这基本上应该可以帮助您实现目标,但还需要使用适合您项目的 Floodlight 字符串值自定义 flDiv.innerHTMLonclick() 函数。

关于javascript - DoubleClick Floodlight onClick,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37062712/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com