0

我试过几次,创建一个“保存到四方形按钮”,但是,也许脚本有问题。

我从站点场地的网站上尝试了这个有效的代码:

<div class="locInfo vcard" style="display: none;">
    <h4>
        <a class="fn" href="">Flying Star Cafe - Menaul</a>
    </h4>
    <p class="adr">
        <span class="street-address">8001 Menaul Blvd NE</span> <br> <span
            class="locality">Albuquerque</span>, <span class="region">NM</span>
        <span class="postal-code">87110-4607</span>
    </p>
</div>
<a href="https://foursquare.com/intent/venue.html"
    class="fourSq-widget">Save to foursquare</a>
<br />
<!-- 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" : "5166539"
        };
        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>

它工作得很好,但如果我在这个场地使用相同的结构:https ://pt.foursquare.com/v/centro-drag%C3%A3o-do-mar-de-arte-e-cultura/4be5f4802468c92887d30043

出事了……

<div class="locInfo vcard" style="display: none;">
    <h4>
        <a class="fn" href="">Centro Dragão do Mar de Arte e Cultura</a>
    </h4>
    <p class="adr">
        <span class="street-address">Rua Dragão do Mar, 81</span> <br> <span
            class="locality">Fortaleza</span>, <span class="region">CE</span> <span class="postal-code">60060-390</span>
    </p>
</div>
<a href="https://foursquare.com/intent/venue.html"
    class="fourSq-widget">Save to foursquare</a>
<br />
<!-- 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" : "5166539"
        };
        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>

有什么线索吗?我不知道问题是否在于场地位置在美国以外......我应该为我的场地使用其他参数吗?

我正在使用 Google Chrome 18.0.1025.162 并在 Apache Tomcat 7.0.27 中运行代码

4

2 回答 2

0

为了确定正确的场地,您应该尽可能多地提供场地的独特细节。在您的情况下,添加场地的电话号码就足够了:

<div class="locInfo vcard" style="display: none;">
    <h4>
        <a class="fn" href="">Centro Drag&#227;o do Mar de Arte e Cultura</a>
    </h4>
    <p class="adr">
        <span class="street-address">R. Drag&#227;o do Mar, 81</span> <br />
        <span class="locality">Fortaleza</span>, <span class="region">CE</span>
        <span class="postal-code">60060-390</span> <br />
        <span class="tel">+55 85 3488-8600</span>
    </p>
</div>
<a href="https://foursquare.com/intent/venue.html" class="fourSq-widget">Save to foursquare</a>
<br />
<script type='text/javascript'>
(function() {
    window.___fourSq = {
        "uid" : "5166539"
    };
    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>
于 2012-04-24T07:48:44.933 回答
0

我遇到了问题,因为我写了一个错误的位置(它与我在 FS 上写的不完全相同)。尝试消除该类并尝试一下...

于 2013-02-09T22:58:32.257 回答