In your connected handler, send your presence.
conn.send($pres({type: 'available'}).c('priority').t(1).up().tree());
Create a handler for listening to presence
conn.addHandler(onPresence, null, 'presence');
Once you get your presence back, then redirect to next page.
var onPresence = function(presence){
//do redirect
}
You should enable logging and evaluate the presence, it may not be yours that you get (depending on how you set up the chat). Also, remember to increment your RID when you change pages.