Reputation: 21
I'm trying to integrate Foursquare with my WebApp. I followed the instructions of Foursquare Developers Documentation but my app doesn't work(have the client ID, client Secret...)
Get the following error: "FoursquareClient not defined"
I have tried this: the .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>
and the 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
}
});
}
Upvotes: 2
Views: 321
Reputation: 1127
Try without all the angle brackets.
var client = new FourSquareClient("3PMAYEX2KZ11R25GWV4WVP0IYEVWU01NVP49890KHA5OWJ21VVB", "PRQKBBE0N0VBUQTQ5R2F1UFGEYFZ322ZNVLHO88991MHC3I0O0VI", "http://url.com.br", "remember_credentials");
and
client.venuesClient.venues("IHR8THISVNU", {
Upvotes: 1