-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null return in front end can be sorted by having an if loop in server end checking if null return different definition. #56
Comments
Have you fixed it? I'll give it a go later |
Didn't mean to close that |
Not given it a go yet let me know if you manage to get it done. I'll try to have a go tomorrow. |
@tormod17 had any luck with solving this? I am stuck a bit. in handler.js I am trying to do the following ac.import(function(err, words) {
ac.findWord(userInput, function(err, found) {
response.write(JSON.stringify(found));
var ran = Math.random();
if (found.length > 10) {
ran = Math.floor(ran * 10);
} else {
ran = Math.floor(ran * found.length);
}
ac.define(found[ran], function(err, definition) {
------------------------- changes below -----------------------
if(definition == null){
console.log("---if loop for null definition");
// change number in ran.
}
else{
// continue with def.
console.log("---- def in handler",definition);
response.write('£' + definition);
response.end('£' + ran.toString());
}
------------------------- changes above -----------------------
});
});
}); Creating that if loop for null definitions. but having a tough time trying to solve how if the definition is null we can get it to run the math.random for the var run again. |
Yeah I tried earlier today and ran a ground and suddenly realised I didn't On 4 October 2015 at 12:03, Sohil Pandya [email protected] wrote:
|
No description provided.
The text was updated successfully, but these errors were encountered: