Open
Conversation
Unfortunately, seems we have to put the Profile in the project root: http://stackoverflow.com/a/15187532
ngondard
reviewed
Dec 11, 2017
| console.log(data); | ||
| if(data.matches.length > 0) { | ||
| // display results | ||
| $('#results').append(getGood(data.matches[0])); |
There was a problem hiding this comment.
The match url sends an array as a result, while data.matches[0] processes only the first item . May I suggest adapting the getGood function so that it handles an array (see my next comment), then calling it with the whole matches array as a parameter?
$('#results').append(getGood(data.matches));
ngondard
reviewed
Dec 11, 2017
| '<img src="ui/img/found.png">' + | ||
| '</div>' + | ||
| '<div class="list-right">' + | ||
| '<h3> Hurrah - we have found a match and its id is ' + item[0] + '</h3>' |
There was a problem hiding this comment.
Herebelow my proposition for parsing the result array. In order to insert a <li> list tag within the existing <li>, I added an <ul> element.
'<h3>Hurrah - here comes the match list!<ul>'
// Parses result array in a list
for(var i in item) {
output += '<li>id: ' + item[i] + '</li>';
}
output += '</ul></h3>';
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not necessarily desirable to merge, but I'm opening this PR just so you have it around!