嗨,我正在尝试使用 fsquare.widget 为foursquare 保存按钮获取监听器。但是网站上的文档很短,所以我无法弄清楚。这是我的代码有什么想法吗?
<!-- Place this anchor tag where you want the button to go -->
<a data-on-load="javascript:test();" href="https://foursquare.com/intent/venue.html" class="fourSq-widget" data-variant="wide">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 = {
"explicit": false,
"onReady": function () {
var widget = new fourSq.widget.SaveTo();
fourSq.widget.Events.bind("follow", function(){
//wish something like this worked
alert('test');
});
}
};
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>