Skip to content

Instantly share code, notes, and snippets.

@SKoschnicke
Created October 19, 2012 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SKoschnicke/3917956 to your computer and use it in GitHub Desktop.
Save SKoschnicke/3917956 to your computer and use it in GitHub Desktop.
JQuery append only accepts real JS arrays, not JQuery-objects representing arrays (as map returns). Solution: Convert to JS array with makeArray.
$('<tr></tr>').append(
$.makeArray($(data).map(function(index, element) {
return $('<td></td>').html(element.instrument_name)
}))
).appendTo(custom_factor_table)
$('<tr></tr>').append(
$.makeArray($(data).map(function(index, element) {
return $('<td></td>').html('bla')
}))
).appendTo(custom_factor_table)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment