How to handle Strophe with "page refreshes"

October 20 - 2009

I'm a very amateur "JavaScripteur", but this is what I do:
* XMPP window value is set to 10
* Before the page is "unloaded" I call a .php file to store JID, SID, and RID

For example:

window.onbeforeunload = byeBye;
function byeBye(){
       $.ajax({
               type: "POST",
               url: "strophestore.php",
               data: "BOSH_RID=" + connection.rid + 
                     "&BOSH_JID=" + connection.jid + 
                     "&BOSH_SID=" + connection.sid,
       });
}

Since this does not work on every browsers, I also call the same on every time "RID_In_SESSION < (connection.rid - 5)".

If someone is interested about the whole code, it can be seen on my contact pages.

I would be most delighted to hear best practices from you guys who really knows what they are doing.

List of all post on LobsterMonster.org