How to handle Strophe with "page refreshes"
October 20 - 2009I'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
- 2010-02-20: XMPP, XFS, buddyloud, FOSDEM
- 2009-10-20: Devox 2009
- 2009-10-20: Strophe + F5
- 2009-10-07: RSS feeds to PubSub nodes
- 2009-08-28: Breaking News -service
- 2009-08-02: Geode-Xmpp-GoogleMap example
- 2009-07-19: Lobstermonster's Buddycloud tweeds
- 2009-07-15: Buddycloud Weather Service
- 2009-06-15: Read and comment BBC Breaking news real time in Lobstermonster Lounge
- 2009-05-17: Geolocation using Firefox's Geode
- 2009-05-17: Geolocation using buddycloud
- 2009-05-08: Simple Weather Forecast Bot
- 2009-05-03: Possibility to ping anonymous web users using my IM client
- 2009-05-01: Online status notified in both ways between Tuomas and the Guest
- 2009-04-30: Contact pages updated
- 2009-04-29: Receive BBC World news as XMPP Message (using the great PubSub feature)!
- 2009-04-19: Example how to send IQ commands to external XMPP server using XEP-0244: IO Data
- 2009-04-19: So how is most of the stuff done on Lobstermonster.org
- 2009-04-18: My mood now on my contact pages.
- 2009-04-15: The incredible XMPP - BOSH - Strophe - Multi-User Chat! :-D
- 2009-04-15: Contact pages ready - and implemented of course with XMPP
- 2009-04-14: Baby got more memory
- 2009-04-13: What have I done and why?