Squish will not record clicks on alert or confirmation dialogs, although it will record a call to the
closeConfirm() function for confirmation dialogs.
Squish for Web cannot interact with such dialogs itself, hence it avoids showing them at all when replaying the script.
There is no useful interaction possible with alert dialogs (other than clicking the OK button) so Squish simply hides them (and clicks the button).
For confirmation dialogs Squish waits for the test script to execute the closeConfirm() function which takes a parameter indicating whether the OK or Cancel button is to be considered to have been clicked.