Created
January 27, 2013 22:23
-
-
Save anonymous/4650951 to your computer and use it in GitHub Desktop.
This file contains 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
function buildButtons(buttons, fnResponse){ | |
for (i = 0; i < buttons.length; i++){ | |
initButton(buttons[i]); | |
} | |
} | |
function initButton(button) { | |
var btnTitle = button.split("|")[0]; | |
var btnName = button.split("|")[1].toString(); | |
var btnElem = $('<button/>', { | |
type: 'button', | |
id: 'btn_' + btnName, | |
html: btnTitle, | |
}) | |
$(btnElem).on('click', function () { | |
//..some other code | |
fnResponse(btnName); //<<------- Issue Should return 'ok' or 'cancel' | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment