2

我正在尝试将 Foursquare 与我的 WebApp 集成。我按照 Foursquare 开发人员文档的说明进行操作,但我的应用程序无法运行(有客户端 ID、客户端密码...)

得到以下错误:“FoursquareClient 未定义”

我试过这个:.html

       <!DOCTYPE html>
        <html  DIR=ltr >
         <head>
         <title>Foursquare</title>
         <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
         <meta name="viewport" content="width=320, initial-scale=1, minimum-scale=1,                       maximum-scale=1">
          <script src="/html5/jquery-1.8.2.min.js" type="text/javascript"></script>
           <script type="text/javascript" src="/html5/foursquare.js"></script>
          <script src="https://ss0.4sqi.net/scripts/third_party/jquery.ba-bbq-eddd4adf74d0c1310a401475178c57df.js" type="text/javascript"></script>
         <script src="https://ss1.4sqi.net/scripts/apisamples-35608dc9c26343e74f5d99fc20bae6c5.js" type="text/javascript"></script>
    </head>
       <body   onload="return viewFoursquareLoad(event)" >
      <div data-role="page"  id="viewFoursquare"  >
        <table id="viewFoursquare_table"><tr><td>
       </td></tr></table>
     </form></div>
   </body>
   </html>

和foursquare.js:

  function viewFoursquareLoad(event) {
       var client = new FourSquareClient("<3PMAYEX2KZ11R25GWV4WVP0IYEVWU01NVP49890KHA5OWJ21VVB>", "<PRQKBBE0N0VBUQTQ5R2F1UFGEYFZ322ZNVLHO88991MHC3I0O0VI>", "<http://url.com.br>", "<remember_credentials>");

  client.venuesClient.venues("<IHR8THISVNU>", {
   onSuccess: function(data)
   {
       alert(data.response);
   },
   onFailure: function(data)
   {
   alert(data.response);
        // the request failed
   }
   });
   }
4

1 回答 1

1

尝试不使用所有尖括号。

 var client = new FourSquareClient("3PMAYEX2KZ11R25GWV4WVP0IYEVWU01NVP49890KHA5OWJ21VVB", "PRQKBBE0N0VBUQTQ5R2F1UFGEYFZ322ZNVLHO88991MHC3I0O0VI", "http://url.com.br", "remember_credentials");

client.venuesClient.venues("IHR8THISVNU", {
于 2012-10-04T13:40:52.647 回答