###A: How do I get a question?
A: How do I get a question?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="scripts/Soapi.js" type="text/javascript"></script>
<script src="scripts/Soapi.Generated.js" type="text/javascript"></script>
<script type="text/javascript">
function run() {
var apiKey = '';
var route = Soapi.RouteFactory('api.stackapps.com', apiKey).QuestionsById(494);
route.answers = true;
route.body = true;
var response = route.getResponse(
function success(data) {
alert(data.items[0].title);
},
function error(err) {
alert("Error:" + err.message);
});
// or
Soapi.RouteFactory('api.stackapps.com', apiKey)
.QuestionsById(494,{
answers: true,
body: true
})
.getResponse(
function success(data) {
alert(data.items[0].title);
},
function error(err) {
alert("Error:" + err.message);
});
}
</script>
</head>
<body onload="run()">
</body>
</html>