当用户点击Adsense ADS时,我尝试在新窗口中打开当前页面
<script>
$(document).ready(function(){
var link= $(location).attr('href');
$('.pub').click(function(){
window.open(link);
});
});
</script>
&#13;
<div class="pub">
here the ADS Code
</div>
&#13;
答案 0 :(得分:0)
您应该使用location.href
,而不是$(location).attr('href')
<script>
$(document).ready(function(){
var link = location.href;
$('.pub').click(function(){
window.open(link);
});
});
</script>