Skip to content

Commit

Permalink
updated ajax logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhea0 committed Dec 28, 2013
1 parent e098713 commit 346228d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion part1/app.js
Expand Up @@ -49,7 +49,7 @@ app.get('/searching', function(req, res){
body = JSON.parse(body);
// logic used to compare search results with the input from user
// console.log(!body.query.results.RDF.item['about'])
if (!body.query.results.RDF.item['about'] === false) {
if (!body.query.results.RDF.item) {
craig = "No results found. Try again.";
} else {
results = body.query.results.RDF.item[0]['about']
Expand Down
2 changes: 1 addition & 1 deletion part2/app.js
Expand Up @@ -50,7 +50,7 @@ function requests(url, callback) {
body = JSON.parse(body);
// console.log(body.query.results.RDF.item)
// logic used to compare search results with the input from user
if (typeof body.query.results.RDF.item === "undefined") {
if (!body.query.results.RDF.item) {
results = "No results found. Try again.";
callback(results);
} else {
Expand Down
2 changes: 1 addition & 1 deletion part3/app.js
Expand Up @@ -134,7 +134,7 @@ function requests(url, callback) {
body = JSON.parse(body);
// console.log(body.query.results.RDF.item)
// logic used to compare search results with the input from user
if (typeof body.query.results.RDF.item === "undefined") {
if (!body.query.results.RDF.item) {
results = "No results found. Try again.";
callback(results);
} else {
Expand Down

0 comments on commit 346228d

Please sign in to comment.