JavaScript novice here....I need to call a JavaScript function that is passed two variables. I then need those 2 variables to be passed to another function via an onClick event. Here is the general idea:
function FirstFunction(var1, var2) {
// Using console.log to verify passed variables
console.log(uid);
console.log(accessToken);
$('#dialog-message').html('<div><button onclick="SecondFunction(var1, var2)">Submit</button></div>');
};
function SecondFunction(var1, var2) {
// Using console.log to verify passed variables
console.log(uid);
console.log(accessToken);
};
I am unable to see var1 & var2 in SecondFunction(). What's wrong here?