使用Javascript的Blogger等待页面

问题描述 投票:0回答:1

我想为我的博客作者的文章中的链接的每次点击安装一个等待页面

(即,在文章中,我放置了一个链接,如果单击该链接,则会首先在等待页面中重定向,我们有一个倒数计时器,然后在此等待倒数之后该链接将打开页)

但是我现在有一个问题,我的博客每次点击都有等待页...甚至在Facebook链接,类别链接...项目链接...上。或者我只是想要每篇文章中的所有链接...但是其他地方...我该怎么办?谢谢您的帮助

要做,我看过这个脚本...

1。他们告诉我在Blogger上创建一个新页面,然后将其复制(以html编辑模式)。

<div class="post-body entry-content" id="post-body-6502615055052287195">
<div dir="rtl" style="text-align: right;" trbidi="on">
<div dir="ltr" style="text-align: center;" trbidi="on">
<style type="text/css">
a#reload {display: none;}
#redirection {    background: #344275;
    padding: 14px;
    font-size: 35px;
    font-family: arial;
    color: white;
    font-weight: bold;}
</style>

<!-- ads -->
<!-- page de telechargement -->

<br />
<!-- ads1 -->
<!-- page de telechargement 1 -->

<br />
<!--text -->

<!-- ads2 -->
<!-- page de telechargement 2 -->

<br />
<!-- ads3 -->

<br />
<div id="redirection">
<div style="text-align: center;">
Wait a few seconds <span id="countdown"> 15 </span> 
  <i class="fa fa-spinner fa-spin" style="font-size: 45px;"></i>
  <a href="https://www.blogger.com/blogger.g?blogID=4500602314747018461#" id="reload">
  </a>
 </div>
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="background-color: white; font-family: &quot;times new roman&quot;; margin-left: auto; margin-right: auto; text-align: center;">
 <tbody>
<tr>
   <td style="text-align: center;"><div style="margin: 0px;">
<a href="https://2.bp.blogspot.com/-OMrIXfuEJIk/W8C7Q1Zw-kI/AAAAAAAAAdw/0Tt3l01G-HMWPNJbHhrXNlSCDlKmq8c9ACLcBGAs/s1600/240_f_30149499_4ch2civydq7ijghtg276rp0g11crqxnk.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;">
     <img border="0" data-original-height="240" data-original-width="640" height="75" src="https://2.bp.blogspot.com/-OMrIXfuEJIk/W8C7Q1Zw-kI/AAAAAAAAAdw/0Tt3l01G-HMWPNJbHhrXNlSCDlKmq8c9ACLcBGAs/s200/240_f_30149499_4ch2civydq7ijghtg276rp0g11crqxnk.jpg" style="cursor: move;" width="200" />
    </a>
    </div>
</td>
  </tr>
<tr>
   <td class="tr-caption" style="font-size: 12.8px;"><div style="margin: 0px;">
<div style="font-size: 12.8px;">
<b><u><span style="color: #3d85c6; font-size: large;">ici</span></u></b></div>
</div>
</td>
  </tr>
</tbody>
</table>
</div>
<script type="text/javascript">//<![CDATA[
//add Font Awesome
      var cb = function() {
        var l = document.createElement('link'); l.rel = 'stylesheet';
        l.href = '//maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css';
        var h = document.getElementsByTagName('head')[0]; h.parentNode.insertBefore(l, h);
      };
      var raf = requestAnimationFrame || mozRequestAnimationFrame ||
          webkitRequestAnimationFrame || msRequestAnimationFrame;
      if (raf) raf(cb);
      else window.addEventListener('load', cb);
//]]></script> 

<script type="text/javascript">
  var seconds;
  var temp;
function removem1() {
    var xkl = getQueryVariable("url");
    var nkl=xkl.replace("&m=1", "");
document.getElementById("reload").innerHTML=nkl;
}
removem1();
document.getElementById('reload').href=window.location.href;
function getQueryVariable(variable)
{
       var query = window.location.search.substring(1);
       var vars = query.split("?&&");
       for (var i=0;i<vars.length;i++) {
               var pair = vars[i].split("=_");
               if(pair[0] == variable){return pair[1];}
       }
       return(false);
}

  function countdown() {
    seconds = document.getElementById('countdown').innerHTML;
    seconds = parseInt(seconds, 10);

    if (seconds == 0) {
      temp = document.getElementById('countdown');
      parent.location.replace(document.getElementById("reload").innerHTML)
           return;
    }
    seconds--;
    temp = document.getElementById('countdown');
    temp.innerHTML = seconds;
    timeoutMyOswego = setTimeout(countdown, 1500);
  } 
setTimeout(function(){ countdown(); }, 5000);
</script>


</div>
</div>

2。然后...要执行它...我也必须在主题主体的末尾复制一个脚本...此脚本:

<script type='text/javascript'>
//<![CDATA[
var allahref=document.getElementsByTagName("a");
for(var c=0;c<allahref.length;c++)
{
if(allahref[c].hostname!="www.(paste here your URL)" && allahref[c].hostname!="")
if(allahref[c].hostname!="web.facebook.com" && allahref[c].hostname!="")
if(allahref[c].hostname!="www.youtube.com" && allahref[c].hostname!="")
if(allahref[c].hostname!="play.google.com" && allahref[c].hostname!="")
if(allahref[c].hostname!="plus.google.com" && allahref[c].hostname!="")
if(allahref[c].hostname!="www.linkedin.com" && allahref[c].hostname!="")
if(allahref[c].hostname!="www.instagram.com" && allahref[c].hostname!="")
if(allahref[c].hostname!="twitter.com" && allahref[c].hostname!="")
if(allahref[c].hostname!="1.bp.blogspot.com" && allahref[c].hostname!="")
if(allahref[c].hostname!="2.bp.blogspot.com" && allahref[c].hostname!="")
if(allahref[c].hostname!="3.bp.blogspot.com" && allahref[c].hostname!="")
if(allahref[c].hostname!="4.bp.blogspot.com" && allahref[c].hostname!="")
if(allahref[c].hostname!="www.blogger.com" && allahref[c].hostname!="")
if(allahref[c].hostname!="www.instagram.com" && allahref[c].hostname!="")
{
allahref[c].href="(paste here the URL of the page)?&&url=_"+allahref[c].href;
}
}
//]]>
</script>

我想为博客作者的一篇文章中的链接上的每次点击安装一个等待页面(即,在一篇文章中,我放置了一个链接,如果您单击该链接,则会在等待中被重定向第一页,...

javascript blogger countdowntimer blogger-dynamic-views
1个回答
0
投票

我认为问题出在步骤2。

© www.soinside.com 2019 - 2024. All rights reserved.