从iframe馈送数据并将其放入一个JavaScript变量

时间:2019-06-16 15:24:31

标签: javascript iframe feed

blogger平台在每个博客帖子下方都有一个iframe代码作为响应小部件。 是否有任何方法可以获取例如反应值的编号并将其放入变量中以进行后期排名?

iframe代码如下:

<iframe allowtransparency="true" class="reactions-iframe" frameborder="0" name="reactions" scrolling="no" src="https://www.blogger.com/blog-post-reactions.g?options=%5B1star,+2stars,+3stars,+4stars,+5stars%5D&amp;textColor=%23000000#http://**********.com/2019/06/blog-post_39.html"></iframe>

并且作为iframe中的html代码,其内容如下:

<html dir="ltr"><head><script type="text/javascript" src="https://www.blogger.com/static/v1/jsbin/2979485952-rx.js"></script>

<style type="text/css">
      body {
        padding: 0;
        margin: 0;
      }

      #rx-options {
        padding: 0.1em;
        margin: 0;
        font-family: 'Trebuchet MS',Trebuchet,Arial,Verdana,Sans-serif;
        font-size: 78%;
        color: #000;
        line-height: 170%;
      }

      /* Properties that don't change with clicking */
      #rx-options .rx-option {
        float: left;
        display: inline;
        background-position: 0% 50%;
        background-repeat: no-repeat;
        text-decoration: none;
        color: #000;
        padding-left: 23px;
        padding-right: 5px;
        margin-left: .7em;
        cursor: pointer;
        background-image: url(img/checks_sprite.png);
      }

      #rx-options a.rx-unchecked {
        background-position: 0 -39px;
        opacity: .7;
        filter: alpha(opacity=70);
      }

      #rx-options a.rx-checked {
        background-position: 0 -239px;
      }

      #rx-options a.rx-unchecked:hover{
        background-position: 0 -139px;
      }

      #rx-options a.rx-option:link {
        color: #000;
        text-decoration: none;
      }

      #rx-options a.rx-option:visited {
        color: #000;
        text-decoration: none;
      }

      #rx-options .rx-disabled {
        opacity: 0.4;
        filter: alpha(opacity=40);
      }

    </style></head>
<body><div id="rx-options"><a class="rx-option rx-unchecked" href="javascript:void(0)"><span class="rx-label">1star</span>
(<span class="rx-count">0</span>)</a> <a class="rx-option rx-unchecked" href="javascript:void(0)"><span class="rx-label">2stars</span>
(<span class="rx-count">0</span>)</a> <a class="rx-option rx-unchecked" href="javascript:void(0)"><span class="rx-label">3stars</span>
(<span class="rx-count">0</span>)</a> <a class="rx-option rx-unchecked" href="javascript:void(0)"><span class="rx-label">4stars</span>
(<span class="rx-count">1</span>)</a> <a class="rx-option rx-unchecked" href="javascript:void(0)"><span class="rx-label">5stars</span>
(<span class="rx-count">1</span>)</a></div>
<script type="text/javascript">

      BLOG_listenOnce(window, 'load', function() {
        if (window.parent == window) {
          document.close();
          document.open();
          document.close();
        }
        
          var a = new BLOG_Annotator(location.hash.substr(1));
        
        a.initialize('rx-options');
      });

      </script></body></html>

有什么主意吗?

0 个答案:

没有答案