2012-04-23 4 views
0

"네모꼴 버튼 저장"을 여러 번 시도했지만 스크립트에 문제가 있습니다. 나는이 장소에 대해 동일한 구조를 사용하는 경우Foursquare 저장 버튼이 장소 데이터를 읽지 않습니다

<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

뭔가 잘못 ...

실마리가 있습니까? 장소 위치가 미국 이외의 지역에 있는지 문제가 있는지 모르겠습니다 ... 내 장소에 사용해야하는 추가 매개 변수가 있습니까?

내가 구글 크롬 18.0.1025.162를 사용하고 올바른 장소를 결정하기 위해 아파치 톰캣 7.0.27

+0

두 번째 코드 조각을 시도 할 때 잘못된 점에 대해 좀 더 구체적으로 설명 할 수 있습니까? 버튼이 작동하지만 장소를 찾지 못했습니까? 이러한 HTML 스 니펫을 사용하여 실제 웹 페이지를 만들면 해당 링크가 도움이됩니다. – smehmood

+0

확실히 : 장소 위치를 보여주는 창이 열리지 만 장소를 인식하지 못합니다. 그것은 채워질 빈 폼을 보여줍니다. –

+0

여기 @smehmood, Foursquare 문서 : [link] (https://pt.foursquare.com/business/brands/offerings/savetofoursquare) –

답변

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> 
+0

고마워, 이제 작동 해. 아마도 FourSquare의 개발자는 장소 URL이 삽입되었을 때 hCard 코드의 기본 골격을 생성하는 문서 섹션이나 페이지에 유효한 태그 목록을 만들 수 있습니다. 다시 한번 감사드립니다. –

0

내가 (정확히 내가 FS에 쓴 동일하지 않았다) 그 문제를 가지고 있었다. 해당 클래스를 제거하고 시도해보십시오.

관련 문제