Something went wrong. Try again later

dynamic_cast

This user has not updated recently.

8 0 8 0
Forum Posts Wiki Points Following Followers

dynamic_cast's forum posts

Avatar image for dynamic_cast
dynamic_cast

8

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#1  Edited By dynamic_cast

why is there html in the response? how does one retrieve just the game information?

Avatar image for dynamic_cast
dynamic_cast

8

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

@chaser324: I don't know if "error" is the correct word to use in relation to the first solution you gave because this updated one is no longer working for me. The complete function still executes to log "done" to the console but the callback isn't firing.

Avatar image for dynamic_cast
dynamic_cast

8

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#4  Edited By dynamic_cast

@chaser324: Thanks. It worked. I read that jQuery automatically appends a callback parameter so I was not bothering with it.

Avatar image for dynamic_cast
dynamic_cast

8

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

@chaser324: http://giantbomb.com/api/search/?api_key=key&query=uncharted&resources=game&format=json

Avatar image for dynamic_cast
dynamic_cast

8

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#6  Edited By dynamic_cast

I have a problem when retrieving data with the format set to json. The debug console says I have a syntax error which is located in the response from GiantBomb.

No Caption Provided

Avatar image for dynamic_cast
dynamic_cast

8

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

Hello,

I am new here and I am using the API to build an app for a class project. I am using jQuery to perform the queries to the database but they fail in the code while the json data is displayed when I simply input the whole query string into a browser. Can somebody help me?

<!doctype html>

<html lang="en">

<head>

<meta charset="utf-8" />

<title>GiantBomb</title>

</head>

<body>

<input type="text" placeholder="Game" id="game"/>

<input type="button" value="Search" id="search"/>

<script type="text/javascript" src="jqtouch/jqtouch/jquery.1.3.2.min.js"></script>

<script src="title.js"></script>

</body>

</html>

var api = "http://www.giantbomb.com/api/search/?api_key=";

var api_key = "";

var query = "&query=";

var format = "&format=json";

$("#search").click(function() {

var game = $("#game").val();

console.log(game.split(" "));

$.ajax({

type: "GET",

url: api + api_key + query + "uncharted" + format,

async: true,

jsonpcallback: "",

contentType: "application/json",

dataType: "jsonp",

success: function(response) {

console.log(response);

}

});

});

I use the same $.ajax() method with themoviedb and it works fine. However, I am getting an error saying Unexpected token ":". What am I doing wrong? Any help appreciated.