Read the WebDialog pages in the API...

There are also many freely available scripts in the PluginStore etc, using WebDialogs, where you can read the RB, HTML and JS etc, to see the 'callback' code format...