I was passing a parameter from an onclick event this way...
<span id="btn1" onclick="DoIt('Var1', 'Var2', 'Var3');return false;">
Go!
</span>
<script type="text/javascript">
function DoIt(Var1, Var2, Var3) {
// some code...
}
</script>
and evertything was working great until I realized that the page is calling the DoSave() function on page load.
I realize I need to encapsulate the DoSave() function like this...
$('#btn1').click(function(event) {
event.stopPropagation();
// where DoIt() code will end up...
});
but I'm confused about how to pass and access the variables that were attached in the onclick event..
onclick="DoIt('Var1', 'Var2', 'Var3');return false;"
How can this be acheived?