Blogspot模板:将小部件输出传递到javascript

Blogspot模板:将小部件输出传递到javascript,javascript,html,xml,blogger,blogspot,Javascript,Html,Xml,Blogger,Blogspot,我想用小部件输出值“”替换您的标签 我只想将小部件输出传递给我的javascript 这是我的代码: <b:section class='section' id='my-html-sec-test'> <b:widget id='HTML555' locked='true' title='MY LABEL' type='HTML' version='1'> <b:widget-settings>

我想用小部件输出值“”替换您的标签 我只想将小部件输出传递给我的javascript

这是我的代码:

  <b:section class='section' id='my-html-sec-test'>
        <b:widget id='HTML555' locked='true' title='MY LABEL' type='HTML' version='1'>
          <b:widget-settings>
            <b:widget-setting name='content'>  Label  </b:widget-setting>
          </b:widget-settings>
          <b:includable id='main'>
      <!-- only display title if it's non-empty -->
      <b:if cond='data:title != &quot;&quot;'>
      </b:if>
      <div class='widget-content'>
        <data:content/>

            <script src="/feeds/posts/default/-/YOUR_LABEL_HERE?published&amp;alt=json-in-script&amp;callback=labelthumbs" type='text/javascript'> </script>

    </div>

      <b:include name='quickedit'/>
    </b:includable>
        </b:widget>
      </b:section>

标签

您需要在
src
之前使用Blogger
expr
,以便将小部件数据内容作为字符串传递

<b:section class='section' id='my-html-sec-test'>
  <b:widget id='HTML555' locked='true' title='MY LABEL' type='HTML' version='1'>
    <b:widget-settings>
      <b:widget-setting name='content'>  Label  </b:widget-setting>
    </b:widget-settings>
    <b:includable id='main'>
      <!-- only display title if it's non-empty -->
      <b:if cond='data:title != &quot;&quot;'>
      </b:if>
      <div class='widget-content'>
        <script expr:src='"/feeds/posts/default/-/" + data:content + "?published&amp;alt=json-in-script&amp;callback=labelthumbs"' type='text/javascript'></script>
      </div>

      <b:include name='quickedit'/>
    </b:includable>
  </b:widget>
</b:section>

标签

您需要在
src
之前使用Blogger
expr
,以便将小部件数据内容作为字符串传递

<b:section class='section' id='my-html-sec-test'>
  <b:widget id='HTML555' locked='true' title='MY LABEL' type='HTML' version='1'>
    <b:widget-settings>
      <b:widget-setting name='content'>  Label  </b:widget-setting>
    </b:widget-settings>
    <b:includable id='main'>
      <!-- only display title if it's non-empty -->
      <b:if cond='data:title != &quot;&quot;'>
      </b:if>
      <div class='widget-content'>
        <script expr:src='"/feeds/posts/default/-/" + data:content + "?published&amp;alt=json-in-script&amp;callback=labelthumbs"' type='text/javascript'></script>
      </div>

      <b:include name='quickedit'/>
    </b:includable>
  </b:widget>
</b:section>

标签