Hi all,
I need to do something like this:
<input type="button" value="click" id="mybtn"
onclick="myfunction('/myController/myAction',
'myfuncionOnOK('/myController2/myAction2',
'myParameter2');',
'myfuncionOnCancel('/myController3/myAction3',
'myParameter3');');" />
The context of this question is that on the onClick I need to call a javascript function that will make an ajax call to the url I provide. It will open a modal div with OK and Cancel buttons.
Up to here it's fine. But then I also needed to tell the javascript function another function with other parameters and urls to be called when an OK button is clicked in the new div. And another one for the Cancel button.
The problem is I can't manage to pass the second argument properly as it doesn't escape properly and gives me javascript errors.
I have done a search for other similar Javascript questions in SO but non of them seem to cover what I need to do.
Anybody knows how could I pass this kind of string parameters to the javascript function? Or maybe there's another better solution of passing this things that I didn't think of.
Thanks in advance