一页上有多个Foursquare

一页上有多个Foursquare

本文介绍了一页上有多个Foursquare“保存"按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个显示场所列表的站点上工作,并且想为列表中的每个场所添加一个Foursquare保存"按钮.是否可以在单个页面上显示多个Foursquare保存"按钮?我曾尝试创建多个vCard区块(每个场所一个),并在每个区块中插入一个保存"按钮,但是这些位置并未被提取.

I am working on a site that displays a list of venues and would like to add a Foursquare 'save' button for each venue in the list. Is it possible to show multiple Foursquare 'save' buttons on a single page? I've tried creating multiple vCard blocks (one for each venue) and inserting a 'save' button in each block but the locations are not being picked up.

推荐答案

检查widgets.jswidgets.asyncbundle.js的来源后,我发现将保存到Foursquare"按钮的data-context属性设置为ID的VCard会将这两个链接在一起.像这样:

After inspecting the source of the widgets.js and widgets.asyncbundle.js I discovered that setting thedata-context atribute of the 'Save to Foursquare' button to the ID of the VCard will link these two. Like so:

<div id="hcard-Station-Amsterdam-Centraal" class="vcard">
    <span class="fn">
        <span class="given-name">Station Amsterdam Centraal</span>
    </span>
    <div class="adr">
        <div class="street-address">stationsplein 15</div>
        <span class="locality">Amsterdam</span>,
        <span class="region">Amsterdam</span> ,
        <span class="postal-code">1012AB</span>
    </div>
</div>
<div id="hcard-Jaarbeursplein" class="vcard">
    <span class="fn">
        <span class="given-name">Jaarbeursplein</span>
    </span>
    <div class="adr">
        <div class="street-address">Jaarbeursplein</div>
        <span class="locality">Utrecht</span>,
        <span class="region">Utrecht</span>,
        <span class="postal-code">3521AL</span>
    </div>
</div>

<a href="https://foursquare.com/intent/venue.html" class="fourSq-widget" data-context="hcard-Station-Amsterdam-Centraal" data-variant="wide">Save to foursquare</a>
<a href="https://foursquare.com/intent/venue.html" class="fourSq-widget" data-context="hcard-Jaarbeursplein" data-variant="wide">Save to foursquare</a>

但是由于尚未对此进行记录,因此可能会在不久的将来进行更改.

But for the fact that this isn't documented, it may be changed in the near future.

这篇关于一页上有多个Foursquare“保存"按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 13:07