我正在一个显示场地列表的网站上工作,并希望为列表中的每个场地添加一个Foursquare“保存”按钮。是否可以在单个页面上显示多个Foursquare“保存”按钮?我尝试过创建多个vCard块(每个场地一个),并在每个块中插入一个“保存”按钮,但是这些位置没有被拾取。在一个页面上多个Foursquare“保存”按钮
回答
检查了widgets.js
和widgets.asyncbundle.js
的来源后,我发现将'Save to Foursquare'按钮的属性设置为VCard的ID将会链接这两个。像这样:
<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>
但是,由于事实上这没有记录,它可能会在不久的将来改变。
保存到foursquare小部件的进行中文档可以通过@https://developer.foursquare.com/overview/widgets访问。他们会随着时间的推移被清理干净,但应该足以帮助这个和未来的小部件相关的问题=)。
特别是,有关您所需的“data-context”属性的文档将很快推送到链接页面。
该文档没有提到页面上多个按钮的'data-context'属性,因此提到这个并且说'但是应该足够好来帮助这个和未来的小部件相关的问题'并不是帮助... – 2012-04-02 15:22:40
The文档将很快更新,以包括该属性 – akdotcom 2012-04-05 17:56:48
好吧,不知道你在为4sq工作,无论如何,当你知道它不包含属性仍然有误导性时,提及文档作为解决方案。添加到您的答案,它将在文档中很快描述,我会撤销我的downvote。 – 2012-04-06 15:50:54
与“数据-VID”试试这个:
<!-- Place this anchor tag where you want the button to go -->
<br />
All In PartyRadio Studio<a href="https://foursquare.com/intent/venue.html" class="fourSq-widget" data-vid="50575a55e0e27c7feb062116">Save to foursquare</a>
<br />
Sing Sing Music Hall<a href="https://foursquare.com/intent/venue.html" class="fourSq-widget" data-vid="4d47d1fe2165721ebe9ac0d7">Save to foursquare</a>
<br />
Retro Klub<a href="https://foursquare.com/intent/venue.html" class="fourSq-widget" data-vid="4d437d813616b60c2764dac2">Save to foursquare</a>
<br />
Tisza Dokk<a href="https://foursquare.com/intent/venue.html" class="fourSq-widget" data-vid="4f73231de4b0e3a99689cc61">Save to foursquare</a>
<br />
Zöld Zsiráf Kultúrpart<a href="https://foursquare.com/intent/venue.html" class="fourSq-widget" data-vid="4ffad97ef13633933ececa5f">Save to foursquare</a>
<!-- Place this script somewhere after the anchor tag above. If you have multiple buttons, only include the script once. -->
<script type='text/javascript'>
(function() {
window.___fourSq = {"uid":"606"};
var s = document.createElement('script');
s.type = 'text/javascript';
s.src = 'http://platform.foursquare.com/js/widgets.js';
s.async = true;
var ph = document.getElementsByTagName('script')[0];
ph.parentNode.insertBefore(s, ph);
})();
</script>
- 1. Uploadify多个按钮 - 一个页面
- 2. 在按钮上刷新一个页面
- 3. 如何在一个页面上选择多个单选按钮?
- 4. 用一个按钮保存多个标签面板
- 5. 一个页面上多个类似Facebook的按钮
- 6. 在同一页面上的多个按钮活动 - android eclipse
- 7. 在同一页面上显示多个Google plus按钮
- 8. WPF多个按钮导航一个框架的多个页面
- 9. 在打印另一个页面的页面上打印按钮
- 10. 在一个按钮上用PHP打开一个新页面
- 11. 如何在单个保存按钮上运行多个查询?
- 12. Facebook多个按钮在单个页面上
- 13. 如何在一个页面上实现更多的一个Facebook iLike按钮?
- 14. 只能在一个按钮中保存多个表格
- 15. 在一个页面中嵌入多个Twitter按钮?
- 16. 流动游戏在一个页面中寻找多个按钮
- 17. 仅从一个页面上的多个按钮定位一个ID(或类别)
- 18. 使用matplotlib在单个pdf页面上保存多个图
- 19. 同一页面性能问题上的多个Tweet按钮
- 20. 如何将两个按钮居中放在一个页面上
- 21. 在一个页面上的两个选择按钮
- 22. 在一个页面上为10个提交按钮编码
- 23. 如何在UITableView上放置一个按钮,如Foursquare
- 24. 我想通过单击十字按钮关闭另一个页面使按钮在一个页面上可见
- 25. 在按钮上打印多个页面在ASP.net中单击
- 26. 多个表单在一个页面上,如何处理后退按钮行为?
- 27. 多个Facebook Like按钮(不同的活动)在一个页面上?
- 28. HTML - 如何在一个页面上高效地完成多个Facebook Like按钮
- 29. 如何在一个页面上使用多个jQuery按钮样式?
- 30. 多个Facebook的“发送”按钮在一个页面上有不同的描述?
务必(4Q文档中未类=“电子名片”的)使用类=“电子名片” – sglessard 2012-02-22 15:06:36
它的工作很好的为我的博客。我有一个需要去的地方,他们现在工作很好。希望4sq团队在未来构建一个更好的解决方案,就像隐藏文本字段一样,因为文本字段的值已成为场地的URL。这可以为页面作者减少很多工作。 – 2012-04-27 02:04:44
这很好。请注意,如果您是组织,则vcard格式有点不同:在父元素上class =“org fn”,然后在包含组织名称的子元素上使用class =“organization-name”。使用这个功能,我可以让我们的两个博物馆位置显示相对的4Square保存按钮。 – 2013-05-20 20:54:37