Created
May 25, 2014 17:24
-
-
Save kenu/9e17c9fe2c9654502d62 to your computer and use it in GitHub Desktop.
js commons
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
var commons = { | |
drop: function (list, i) { | |
return list.slice(0, i).concat(list.slice(i + 1)); | |
}, | |
getOptions: function(list, vkey, nkey) { | |
var listHtml = ""; | |
for (var i=0 ; i<list.length ; i++) { | |
listHtml += "<option value='"; | |
listHtml += list[i][vkey]; | |
listHtml += "'>"; | |
listHtml += list[i][nkey]; | |
listHtml += "</option>"; | |
} | |
return listHtml; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment