Scripting Question - Go & Cancel Button

Hello, could someone just give me a little help with the scripting. Seems mainly straightforward, but I get lost in the docs. For a dialog button that has a Go Button and Cancel Button, what is the code to determine which one is clicked in the jsscript section?

{
	var dlg = DOpus.Dlg();
    dlg.window = clickData.func.sourcetab;
    dlg.template = "dialog";
    dlg.detach = true;
    dlg.Show();

    if go button clicked
      do this
    else if cancel button clicked
      do that

}

Hopefully that makes some sense? Thank you very much.

Docs for Show():

Dialog

Perfect, thank you.