source: sandbox/jabberit_messenger/trophy/strophejs/doc/files/core-js.html @ 2271

Revision 2271, 117.5 KB checked in by alexandrecorreia, 14 years ago (diff)

Ticket #986 - Reimplementar interface mais leve para o IM, sem a necessidades de plugins adicionais.

  • Property svn:executable set to *
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
2
3<html><head><title>strophe.js</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad()"><script language=JavaScript><!--
4if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
5
6<!--  Generated by Natural Docs, version 1.4 -->
7<!--  http://www.naturaldocs.org  -->
8
9<!-- saved from url=(0026)http://www.naturaldocs.org -->
10
11
12
13
14<div id=Content><div class="CFile"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="strophe.js"></a>strophe.js</h1><div class=CBody><p>A JavaScript library for XMPP BOSH.</p><p>This is the JavaScript version of the Strophe library.&nbsp;  Since JavaScript has no facilities for persistent TCP connections, this library uses Bidirectional-streams Over Synchronous HTTP (BOSH) to emulate a persistent, stateful, two-way connection to an XMPP server.&nbsp;  More information on BOSH can be found in XEP 124.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#strophe.js" >strophe.js</a></td><td class=SDescription>A JavaScript library for XMPP BOSH.</td></tr><tr class="SGroup"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#$build" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">$build</a></td><td class=SDescription>Create a Strophe.Builder. </td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#$msg" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">$msg</a></td><td class=SDescription>Create a Strophe.Builder with a &lt;message/&gt; element as the root.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#$iq" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">$iq</a></td><td class=SDescription>Create a Strophe.Builder with an &lt;iq/&gt; element as the root.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#$pres" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">$pres</a></td><td class=SDescription>Create a Strophe.Builder with a &lt;presence/&gt; element as the root.</td></tr><tr class="SClass"><td class=SEntry><a href="#Strophe" >Strophe</a></td><td class=SDescription>An object container for all Strophe library functions.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Strophe.Constants" >Constants</a></td><td class=SDescription></td></tr><tr class="SConstant SIndent2 SMarked"><td class=SEntry><a href="#Strophe.VERSION" >VERSION</a></td><td class=SDescription>The version of the Strophe library. </td></tr><tr class="SConstant SIndent2"><td class=SEntry><a href="#Strophe.XMPP_Namespace_Constants" >XMPP Namespace Constants</a></td><td class=SDescription>Common namespace constants from the XMPP RFCs and XEPs.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Strophe.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.addNamespace" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">addNamespace</a></td><td class=SDescription>This function is used to extend the current namespaces in Strophe.NS. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Strophe.Constants" >Constants</a></td><td class=SDescription></td></tr><tr class="SConstant SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Connection_Status_Constants" >Connection Status Constants</a></td><td class=SDescription>Connection status constants for use by the connection handler callback.</td></tr><tr class="SConstant SIndent2"><td class=SEntry><a href="#Strophe.Log_Level_Constants" >Log Level Constants</a></td><td class=SDescription>Logging level indicators.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Strophe.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.forEachChild" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">forEachChild</a></td><td class=SDescription>Map a function over some or all child elements of a given element.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.isTagEqual" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">isTagEqual</a></td><td class=SDescription>Compare an element&rsquo;s tag name with a string.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.xmlElement" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">xmlElement</a></td><td class=SDescription>Create an XML DOM element.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.xmlescape" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">xmlescape</a></td><td class=SDescription>Excapes invalid xml characters.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.xmlTextNode" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">xmlTextNode</a></td><td class=SDescription>Creates an XML DOM text node.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.getText" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">getText</a></td><td class=SDescription>Get the concatenation of all text children of an element.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.copyElement" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">copyElement</a></td><td class=SDescription>Copy an XML DOM element.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.escapeNode" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">escapeNode</a></td><td class=SDescription>Escape the node part (also called local part) of a JID.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.unescapeNode" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMouseOut="HideTip('tt14')">unescapeNode</a></td><td class=SDescription>Unescape a node part (also called local part) of a JID.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.getNodeFromJid" id=link15 onMouseOver="ShowTip(event, 'tt15', 'link15')" onMouseOut="HideTip('tt15')">getNodeFromJid</a></td><td class=SDescription>Get the node portion of a JID String.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.getDomainFromJid" id=link16 onMouseOver="ShowTip(event, 'tt16', 'link16')" onMouseOut="HideTip('tt16')">getDomainFromJid</a></td><td class=SDescription>Get the domain portion of a JID String.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.getResourceFromJid" id=link17 onMouseOver="ShowTip(event, 'tt17', 'link17')" onMouseOut="HideTip('tt17')">getResourceFromJid</a></td><td class=SDescription>Get the resource portion of a JID String.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.getBareJidFromJid" id=link18 onMouseOver="ShowTip(event, 'tt18', 'link18')" onMouseOut="HideTip('tt18')">getBareJidFromJid</a></td><td class=SDescription>Get the bare JID from a JID String.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.log" id=link19 onMouseOver="ShowTip(event, 'tt19', 'link19')" onMouseOut="HideTip('tt19')">log</a></td><td class=SDescription>User overrideable logging function.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.debug" id=link20 onMouseOver="ShowTip(event, 'tt20', 'link20')" onMouseOut="HideTip('tt20')">debug</a></td><td class=SDescription>Log a message at the Strophe.LogLevel.DEBUG level.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.info" id=link21 onMouseOver="ShowTip(event, 'tt21', 'link21')" onMouseOut="HideTip('tt21')">info</a></td><td class=SDescription>Log a message at the Strophe.LogLevel.INFO level.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.warn" id=link22 onMouseOver="ShowTip(event, 'tt22', 'link22')" onMouseOut="HideTip('tt22')">warn</a></td><td class=SDescription>Log a message at the Strophe.LogLevel.WARN level.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.error" id=link23 onMouseOver="ShowTip(event, 'tt23', 'link23')" onMouseOut="HideTip('tt23')">error</a></td><td class=SDescription>Log a message at the Strophe.LogLevel.ERROR level.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.fatal" id=link24 onMouseOver="ShowTip(event, 'tt24', 'link24')" onMouseOut="HideTip('tt24')">fatal</a></td><td class=SDescription>Log a message at the Strophe.LogLevel.FATAL level.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.serialize" id=link25 onMouseOver="ShowTip(event, 'tt25', 'link25')" onMouseOut="HideTip('tt25')">serialize</a></td><td class=SDescription>Render a DOM element and all descendants to a String.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.addConnectionPlugin" id=link26 onMouseOver="ShowTip(event, 'tt26', 'link26')" onMouseOut="HideTip('tt26')">addConnectionPlugin</a></td><td class=SDescription>Extends the Strophe.Connection object with the given plugin.</td></tr><tr class="SClass"><td class=SEntry><a href="#Strophe.Builder" >Strophe.<wbr>Builder</a></td><td class=SDescription>XML DOM builder.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Strophe.Builder.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Builder.Strophe.Builder" id=link27 onMouseOver="ShowTip(event, 'tt27', 'link27')" onMouseOut="HideTip('tt27')">Strophe.<wbr>Builder</a></td><td class=SDescription>Create a Strophe.Builder object.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.Builder.tree" id=link28 onMouseOver="ShowTip(event, 'tt28', 'link28')" onMouseOut="HideTip('tt28')">tree</a></td><td class=SDescription>Return the DOM tree.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Builder.toString" id=link29 onMouseOver="ShowTip(event, 'tt29', 'link29')" onMouseOut="HideTip('tt29')">toString</a></td><td class=SDescription>Serialize the DOM tree to a String.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.Builder.up" id=link30 onMouseOver="ShowTip(event, 'tt30', 'link30')" onMouseOut="HideTip('tt30')">up</a></td><td class=SDescription>Make the current parent element the new current element.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Builder.attrs" id=link31 onMouseOver="ShowTip(event, 'tt31', 'link31')" onMouseOut="HideTip('tt31')">attrs</a></td><td class=SDescription>Add or modify attributes of the current element.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.Builder.c" id=link32 onMouseOver="ShowTip(event, 'tt32', 'link32')" onMouseOut="HideTip('tt32')">c</a></td><td class=SDescription>Add a child to the current element and make it the new current element.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Builder.cnode" id=link33 onMouseOver="ShowTip(event, 'tt33', 'link33')" onMouseOut="HideTip('tt33')">cnode</a></td><td class=SDescription>Add a child to the current element and make it the new current element.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.Builder.t" id=link34 onMouseOver="ShowTip(event, 'tt34', 'link34')" onMouseOut="HideTip('tt34')">t</a></td><td class=SDescription>Add a child text element.</td></tr><tr class="SClass"><td class=SEntry><a href="#Strophe.Connection" >Strophe.<wbr>Connection</a></td><td class=SDescription>XMPP Connection manager.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Strophe.Connection.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Connection.Strophe.Connection" id=link35 onMouseOver="ShowTip(event, 'tt35', 'link35')" onMouseOut="HideTip('tt35')">Strophe.<wbr>Connection</a></td><td class=SDescription>Create and initialize a Strophe.Connection object.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.Connection.reset" id=link36 onMouseOver="ShowTip(event, 'tt36', 'link36')" onMouseOut="HideTip('tt36')">reset</a></td><td class=SDescription>Reset the connection.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Connection.pause" id=link37 onMouseOver="ShowTip(event, 'tt37', 'link37')" onMouseOut="HideTip('tt37')">pause</a></td><td class=SDescription>Pause the request manager.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.Connection.resume" id=link38 onMouseOver="ShowTip(event, 'tt38', 'link38')" onMouseOut="HideTip('tt38')">resume</a></td><td class=SDescription>Resume the request manager.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Connection.getUniqueId" id=link39 onMouseOver="ShowTip(event, 'tt39', 'link39')" onMouseOut="HideTip('tt39')">getUniqueId</a></td><td class=SDescription>Generate a unique ID for use in &lt;iq/&gt; elements.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.Connection.connect" id=link40 onMouseOver="ShowTip(event, 'tt40', 'link40')" onMouseOut="HideTip('tt40')">connect</a></td><td class=SDescription>Starts the connection process.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Connection.attach" id=link41 onMouseOver="ShowTip(event, 'tt41', 'link41')" onMouseOut="HideTip('tt41')">attach</a></td><td class=SDescription>Attach to an already created and authenticated BOSH session.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.Connection.xmlInput" id=link42 onMouseOver="ShowTip(event, 'tt42', 'link42')" onMouseOut="HideTip('tt42')">xmlInput</a></td><td class=SDescription>User overrideable function that receives XML data coming into the connection.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Connection.xmlOutput" id=link43 onMouseOver="ShowTip(event, 'tt43', 'link43')" onMouseOut="HideTip('tt43')">xmlOutput</a></td><td class=SDescription>User overrideable function that receives XML data sent to the connection.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.Connection.rawInput" id=link44 onMouseOver="ShowTip(event, 'tt44', 'link44')" onMouseOut="HideTip('tt44')">rawInput</a></td><td class=SDescription>User overrideable function that receives raw data coming into the connection.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Connection.rawOutput" id=link45 onMouseOver="ShowTip(event, 'tt45', 'link45')" onMouseOut="HideTip('tt45')">rawOutput</a></td><td class=SDescription>User overrideable function that receives raw data sent to the connection.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.Connection.send" id=link46 onMouseOver="ShowTip(event, 'tt46', 'link46')" onMouseOut="HideTip('tt46')">send</a></td><td class=SDescription>Send a stanza.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Connection.flush" id=link47 onMouseOver="ShowTip(event, 'tt47', 'link47')" onMouseOut="HideTip('tt47')">flush</a></td><td class=SDescription>Immediately send any pending outgoing data.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.Connection.sendIQ" id=link48 onMouseOver="ShowTip(event, 'tt48', 'link48')" onMouseOut="HideTip('tt48')">sendIQ</a></td><td class=SDescription>Helper function to send IQ stanzas.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Connection.addTimedHandler" id=link49 onMouseOver="ShowTip(event, 'tt49', 'link49')" onMouseOut="HideTip('tt49')">addTimedHandler</a></td><td class=SDescription>Add a timed handler to the connection.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.Connection.deleteTimedHandler" id=link50 onMouseOver="ShowTip(event, 'tt50', 'link50')" onMouseOut="HideTip('tt50')">deleteTimedHandler</a></td><td class=SDescription>Delete a timed handler for a connection.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Connection.addHandler" id=link51 onMouseOver="ShowTip(event, 'tt51', 'link51')" onMouseOut="HideTip('tt51')">addHandler</a></td><td class=SDescription>Add a stanza handler for the connection.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.Connection.deleteHandler" id=link52 onMouseOver="ShowTip(event, 'tt52', 'link52')" onMouseOut="HideTip('tt52')">deleteHandler</a></td><td class=SDescription>Delete a stanza handler for a connection.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Connection.disconnect" id=link53 onMouseOver="ShowTip(event, 'tt53', 'link53')" onMouseOut="HideTip('tt53')">disconnect</a></td><td class=SDescription>Start the graceful disconnection process.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
15
16<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Functions"></a>Functions</h3></div></div>
17
18<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="$build"></a>$build</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function $build(</td><td class=PParameter nowrap>name,</td></tr><tr><td></td><td class=PParameter nowrap>attrs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Create a Strophe.Builder.&nbsp; This is an alias for &lsquo;new Strophe.Builder(name, attrs)&rsquo;.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) name</td><td class=CDLDescription>The root element name.</td></tr><tr><td class=CDLEntry>(Object) attrs</td><td class=CDLDescription>The attributes for the root element in object notation.</td></tr></table><h4 class=CHeading>Returns</h4><p>A new Strophe.Builder object.</p></div></div></div>
19
20<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="$msg"></a>$msg</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function $msg(</td><td class=PParameter nowrap>attrs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Create a Strophe.Builder with a &lt;message/&gt; element as the root.</p><h4 class=CHeading>Parmaeters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(Object) attrs</td><td class=CDLDescription>The &lt;message/&gt; element attributes in object notation.</td></tr></table><h4 class=CHeading>Returns</h4><p>A new Strophe.Builder object.</p></div></div></div>
21
22<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="$iq"></a>$iq</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function $iq(</td><td class=PParameter nowrap>attrs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Create a Strophe.Builder with an &lt;iq/&gt; element as the root.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(Object) attrs</td><td class=CDLDescription>The &lt;iq/&gt; element attributes in object notation.</td></tr></table><h4 class=CHeading>Returns</h4><p>A new Strophe.Builder object.</p></div></div></div>
23
24<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="$pres"></a>$pres</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function $pres(</td><td class=PParameter nowrap>attrs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Create a Strophe.Builder with a &lt;presence/&gt; element as the root.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(Object) attrs</td><td class=CDLDescription>The &lt;presence/&gt; element attributes in object notation.</td></tr></table><h4 class=CHeading>Returns</h4><p>A new Strophe.Builder object.</p></div></div></div>
25
26<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="Strophe"></a>Strophe</h2><div class=CBody><p>An object container for all Strophe library functions.</p><p>This class is just a container for all the objects and constants used in the library.&nbsp;  It is not meant to be instantiated, but to provide a namespace for library objects, constants, and functions.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#Strophe.Constants" >Constants</a></td><td class=SDescription></td></tr><tr class="SConstant SIndent1 SMarked"><td class=SEntry><a href="#Strophe.VERSION" >VERSION</a></td><td class=SDescription>The version of the Strophe library. </td></tr><tr class="SConstant SIndent1"><td class=SEntry><a href="#Strophe.XMPP_Namespace_Constants" >XMPP Namespace Constants</a></td><td class=SDescription>Common namespace constants from the XMPP RFCs and XEPs.</td></tr><tr class="SGroup"><td class=SEntry><a href="#Strophe.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.addNamespace" id=link54 onMouseOver="ShowTip(event, 'tt5', 'link54')" onMouseOut="HideTip('tt5')">addNamespace</a></td><td class=SDescription>This function is used to extend the current namespaces in Strophe.NS. </td></tr><tr class="SGroup"><td class=SEntry><a href="#Strophe.Constants" >Constants</a></td><td class=SDescription></td></tr><tr class="SConstant SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Connection_Status_Constants" >Connection Status Constants</a></td><td class=SDescription>Connection status constants for use by the connection handler callback.</td></tr><tr class="SConstant SIndent1"><td class=SEntry><a href="#Strophe.Log_Level_Constants" >Log Level Constants</a></td><td class=SDescription>Logging level indicators.</td></tr><tr class="SGroup"><td class=SEntry><a href="#Strophe.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.forEachChild" id=link55 onMouseOver="ShowTip(event, 'tt6', 'link55')" onMouseOut="HideTip('tt6')">forEachChild</a></td><td class=SDescription>Map a function over some or all child elements of a given element.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.isTagEqual" id=link56 onMouseOver="ShowTip(event, 'tt7', 'link56')" onMouseOut="HideTip('tt7')">isTagEqual</a></td><td class=SDescription>Compare an element&rsquo;s tag name with a string.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.xmlElement" id=link57 onMouseOver="ShowTip(event, 'tt8', 'link57')" onMouseOut="HideTip('tt8')">xmlElement</a></td><td class=SDescription>Create an XML DOM element.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.xmlescape" id=link58 onMouseOver="ShowTip(event, 'tt9', 'link58')" onMouseOut="HideTip('tt9')">xmlescape</a></td><td class=SDescription>Excapes invalid xml characters.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.xmlTextNode" id=link59 onMouseOver="ShowTip(event, 'tt10', 'link59')" onMouseOut="HideTip('tt10')">xmlTextNode</a></td><td class=SDescription>Creates an XML DOM text node.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.getText" id=link60 onMouseOver="ShowTip(event, 'tt11', 'link60')" onMouseOut="HideTip('tt11')">getText</a></td><td class=SDescription>Get the concatenation of all text children of an element.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.copyElement" id=link61 onMouseOver="ShowTip(event, 'tt12', 'link61')" onMouseOut="HideTip('tt12')">copyElement</a></td><td class=SDescription>Copy an XML DOM element.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.escapeNode" id=link62 onMouseOver="ShowTip(event, 'tt13', 'link62')" onMouseOut="HideTip('tt13')">escapeNode</a></td><td class=SDescription>Escape the node part (also called local part) of a JID.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.unescapeNode" id=link63 onMouseOver="ShowTip(event, 'tt14', 'link63')" onMouseOut="HideTip('tt14')">unescapeNode</a></td><td class=SDescription>Unescape a node part (also called local part) of a JID.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.getNodeFromJid" id=link64 onMouseOver="ShowTip(event, 'tt15', 'link64')" onMouseOut="HideTip('tt15')">getNodeFromJid</a></td><td class=SDescription>Get the node portion of a JID String.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.getDomainFromJid" id=link65 onMouseOver="ShowTip(event, 'tt16', 'link65')" onMouseOut="HideTip('tt16')">getDomainFromJid</a></td><td class=SDescription>Get the domain portion of a JID String.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.getResourceFromJid" id=link66 onMouseOver="ShowTip(event, 'tt17', 'link66')" onMouseOut="HideTip('tt17')">getResourceFromJid</a></td><td class=SDescription>Get the resource portion of a JID String.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.getBareJidFromJid" id=link67 onMouseOver="ShowTip(event, 'tt18', 'link67')" onMouseOut="HideTip('tt18')">getBareJidFromJid</a></td><td class=SDescription>Get the bare JID from a JID String.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.log" id=link68 onMouseOver="ShowTip(event, 'tt19', 'link68')" onMouseOut="HideTip('tt19')">log</a></td><td class=SDescription>User overrideable logging function.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.debug" id=link69 onMouseOver="ShowTip(event, 'tt20', 'link69')" onMouseOut="HideTip('tt20')">debug</a></td><td class=SDescription>Log a message at the Strophe.LogLevel.DEBUG level.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.info" id=link70 onMouseOver="ShowTip(event, 'tt21', 'link70')" onMouseOut="HideTip('tt21')">info</a></td><td class=SDescription>Log a message at the Strophe.LogLevel.INFO level.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.warn" id=link71 onMouseOver="ShowTip(event, 'tt22', 'link71')" onMouseOut="HideTip('tt22')">warn</a></td><td class=SDescription>Log a message at the Strophe.LogLevel.WARN level.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.error" id=link72 onMouseOver="ShowTip(event, 'tt23', 'link72')" onMouseOut="HideTip('tt23')">error</a></td><td class=SDescription>Log a message at the Strophe.LogLevel.ERROR level.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.fatal" id=link73 onMouseOver="ShowTip(event, 'tt24', 'link73')" onMouseOut="HideTip('tt24')">fatal</a></td><td class=SDescription>Log a message at the Strophe.LogLevel.FATAL level.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.serialize" id=link74 onMouseOver="ShowTip(event, 'tt25', 'link74')" onMouseOut="HideTip('tt25')">serialize</a></td><td class=SDescription>Render a DOM element and all descendants to a String.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.addConnectionPlugin" id=link75 onMouseOver="ShowTip(event, 'tt26', 'link75')" onMouseOut="HideTip('tt26')">addConnectionPlugin</a></td><td class=SDescription>Extends the Strophe.Connection object with the given plugin.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
27
28<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.Constants"></a>Constants</h3></div></div>
29
30<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="Strophe.VERSION"></a>VERSION</h3><div class=CBody><p>The version of the Strophe library.&nbsp; Unreleased builds will have a version of head-HASH where HASH is a partial revision.</p></div></div></div>
31
32<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="Strophe.XMPP_Namespace_Constants"></a>XMPP Namespace Constants</h3><div class=CBody><p>Common namespace constants from the XMPP RFCs and XEPs.</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry><a name="Strophe.XMPP_Namespace_Constants.NS.HTTPBIND"></a>NS.HTTPBIND</td><td class=CDLDescription>HTTP BIND namespace from XEP 124.</td></tr><tr><td class=CDLEntry><a name="Strophe.XMPP_Namespace_Constants.NS.BOSH"></a>NS.BOSH</td><td class=CDLDescription>BOSH namespace from XEP 206.</td></tr><tr><td class=CDLEntry><a name="Strophe.XMPP_Namespace_Constants.NS.CLIENT"></a>NS.CLIENT</td><td class=CDLDescription>Main XMPP client namespace.</td></tr><tr><td class=CDLEntry><a name="Strophe.XMPP_Namespace_Constants.NS.AUTH"></a>NS.AUTH</td><td class=CDLDescription>Legacy authentication namespace.</td></tr><tr><td class=CDLEntry><a name="Strophe.XMPP_Namespace_Constants.NS.ROSTER"></a>NS.ROSTER</td><td class=CDLDescription>Roster operations namespace.</td></tr><tr><td class=CDLEntry><a name="Strophe.XMPP_Namespace_Constants.NS.PROFILE"></a>NS.PROFILE</td><td class=CDLDescription>Profile namespace.</td></tr><tr><td class=CDLEntry><a name="Strophe.XMPP_Namespace_Constants.NS.DISCO_INFO"></a>NS.DISCO_INFO</td><td class=CDLDescription>Service discovery info namespace from XEP 30.</td></tr><tr><td class=CDLEntry><a name="Strophe.XMPP_Namespace_Constants.NS.DISCO_ITEMS"></a>NS.DISCO_ITEMS</td><td class=CDLDescription>Service discovery items namespace from XEP 30.</td></tr><tr><td class=CDLEntry><a name="Strophe.XMPP_Namespace_Constants.NS.MUC"></a>NS.MUC</td><td class=CDLDescription>Multi-User Chat namespace from XEP 45.</td></tr><tr><td class=CDLEntry><a name="Strophe.XMPP_Namespace_Constants.NS.SASL"></a>NS.SASL</td><td class=CDLDescription>XMPP SASL namespace from RFC 3920.</td></tr><tr><td class=CDLEntry><a name="Strophe.XMPP_Namespace_Constants.NS.STREAM"></a>NS.STREAM</td><td class=CDLDescription>XMPP Streams namespace from RFC 3920.</td></tr><tr><td class=CDLEntry><a name="Strophe.XMPP_Namespace_Constants.NS.BIND"></a>NS.BIND</td><td class=CDLDescription>XMPP Binding namespace from RFC 3920.</td></tr><tr><td class=CDLEntry><a name="Strophe.XMPP_Namespace_Constants.NS.SESSION"></a>NS.SESSION</td><td class=CDLDescription>XMPP Session namespace from RFC 3920.</td></tr></table></div></div></div>
33
34<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.Functions"></a>Functions</h3></div></div>
35
36<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.addNamespace"></a>addNamespace</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>addNamespace: function (</td><td class=PParameter nowrap>name,</td></tr><tr><td></td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>This function is used to extend the current namespaces in Strophe.NS.&nbsp;  It takes a key and a value with the key being the name of the new namespace, with its actual value.&nbsp; For example: Strophe.addNamespace(&lsquo;PUBSUB&rsquo;, &ldquo;<a href="http://jabber.org/protocol/pubsub" class=LURL target=_top>http://jabber.org/protocol/pubsub</a>&rdquo;);</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) name</td><td class=CDLDescription>The name under which the namespace will be referenced under Strophe.NS</td></tr><tr><td class=CDLEntry>(String) value</td><td class=CDLDescription>The actual namespace.</td></tr></table></div></div></div>
37
38<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.Constants"></a>Constants</h3></div></div>
39
40<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection_Status_Constants"></a>Connection Status Constants</h3><div class=CBody><p>Connection status constants for use by the connection handler callback.</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry><a name="Strophe.Connection_Status_Constants.Status.ERROR"></a>Status.ERROR</td><td class=CDLDescription>An error has occurred</td></tr><tr><td class=CDLEntry><a name="Strophe.Connection_Status_Constants.Status.CONNECTING"></a>Status.CONNECTING</td><td class=CDLDescription>The connection is currently being made</td></tr><tr><td class=CDLEntry><a name="Strophe.Connection_Status_Constants.Status.CONNFAIL"></a>Status.CONNFAIL</td><td class=CDLDescription>The connection attempt failed</td></tr><tr><td class=CDLEntry><a name="Strophe.Connection_Status_Constants.Status.AUTHENTICATING"></a>Status.AUTHENTICATING</td><td class=CDLDescription>The connection is authenticating</td></tr><tr><td class=CDLEntry><a name="Strophe.Connection_Status_Constants.Status.AUTHFAIL"></a>Status.AUTHFAIL</td><td class=CDLDescription>The authentication attempt failed</td></tr><tr><td class=CDLEntry><a name="Strophe.Connection_Status_Constants.Status.CONNECTED"></a>Status.CONNECTED</td><td class=CDLDescription>The connection has succeeded</td></tr><tr><td class=CDLEntry><a name="Strophe.Connection_Status_Constants.Status.DISCONNECTED"></a>Status.DISCONNECTED</td><td class=CDLDescription>The connection has been terminated</td></tr><tr><td class=CDLEntry><a name="Strophe.Connection_Status_Constants.Status.DISCONNECTING"></a>Status.DISCONNECTING</td><td class=CDLDescription>The connection is currently being terminated</td></tr><tr><td class=CDLEntry><a name="Strophe.Connection_Status_Constants.Status.ATTACHED"></a>Status.ATTACHED</td><td class=CDLDescription>The connection has been attached</td></tr></table></div></div></div>
41
42<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="Strophe.Log_Level_Constants"></a>Log Level Constants</h3><div class=CBody><p>Logging level indicators.</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry><a name="Strophe.Log_Level_Constants.LogLevel.DEBUG"></a>LogLevel.DEBUG</td><td class=CDLDescription>Debug output</td></tr><tr><td class=CDLEntry><a name="Strophe.Log_Level_Constants.LogLevel.INFO"></a>LogLevel.INFO</td><td class=CDLDescription>Informational output</td></tr><tr><td class=CDLEntry><a name="Strophe.Log_Level_Constants.LogLevel.WARN"></a>LogLevel.WARN</td><td class=CDLDescription>Warnings</td></tr><tr><td class=CDLEntry><a name="Strophe.Log_Level_Constants.LogLevel.ERROR"></a>LogLevel.ERROR</td><td class=CDLDescription>Errors</td></tr><tr><td class=CDLEntry><a name="Strophe.Log_Level_Constants.LogLevel.FATAL"></a>LogLevel.FATAL</td><td class=CDLDescription>Fatal errors</td></tr></table></div></div></div>
43
44<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.Functions"></a>Functions</h3></div></div>
45
46<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.forEachChild"></a>forEachChild</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>forEachChild: function (</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>elemName,</td></tr><tr><td></td><td class=PParameter nowrap>func</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Map a function over some or all child elements of a given element.</p><p>This is a small convenience function for mapping a function over some or all of the children of an element.&nbsp;  If elemName is null, all children will be passed to the function, otherwise only children whose tag names match elemName will be passed.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(XMLElement) elem</td><td class=CDLDescription>The element to operate on.</td></tr><tr><td class=CDLEntry>(String) elemName</td><td class=CDLDescription>The child element tag name filter.</td></tr><tr><td class=CDLEntry>(Function) func</td><td class=CDLDescription>The function to apply to each child.&nbsp;  This function should take a single argument, a DOM element.</td></tr></table></div></div></div>
47
48<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.isTagEqual"></a>isTagEqual</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>isTagEqual: function (</td><td class=PParameter nowrap>el,</td></tr><tr><td></td><td class=PParameter nowrap>name</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Compare an element&rsquo;s tag name with a string.</p><p>This function is case insensitive.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(XMLElement) el</td><td class=CDLDescription>A DOM element.</td></tr><tr><td class=CDLEntry>(String) name</td><td class=CDLDescription>The element name.</td></tr></table><h4 class=CHeading>Returns</h4><p>true if the element&rsquo;s tag name matches <u>el</u>, and false otherwise.</p></div></div></div>
49
50<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.xmlElement"></a>xmlElement</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>xmlElement: function (</td><td class=PParameter nowrap>name</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Create an XML DOM element.</p><p>This function creates an XML DOM element correctly across all implementations.&nbsp; Specifically the Microsoft implementation of document.createElement makes DOM elements with 43+ default attributes unless elements are created with the ActiveX object Microsoft.XMLDOM.</p><p>Most DOMs force element names to lowercase, so we use the _realname attribute on the created element to store the case sensitive name.&nbsp;  This is required to generate proper XML for things like vCard avatars (XEP 153).&nbsp;  This attribute is stripped out before being sent over the wire or serialized, but you may notice it during debugging.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) name</td><td class=CDLDescription>The name for the element.</td></tr><tr><td class=CDLEntry>(Array) attrs</td><td class=CDLDescription>An optional array of key/value pairs to use as element attributes in the following format [[&lsquo;key1&rsquo;, &lsquo;value1&rsquo;], [&lsquo;key2&rsquo;, &lsquo;value2&rsquo;]]</td></tr><tr><td class=CDLEntry>(String) text</td><td class=CDLDescription>The text child data for the element.</td></tr></table><h4 class=CHeading>Returns</h4><p>A new XML DOM element.</p></div></div></div>
51
52<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.xmlescape"></a>xmlescape</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>xmlescape: function(</td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Excapes invalid xml characters.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) text</td><td class=CDLDescription>text to escape.</td></tr></table><h4 class=CHeading>Returns</h4><p>Escaped text.</p></div></div></div>
53
54<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.xmlTextNode"></a>xmlTextNode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>xmlTextNode: function (</td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates an XML DOM text node.</p><p>Provides a cross implementation version of document.createTextNode.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) text</td><td class=CDLDescription>The content of the text node.</td></tr></table><h4 class=CHeading>Returns</h4><p>A new XML DOM text node.</p></div></div></div>
55
56<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.getText"></a>getText</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getText: function (</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get the concatenation of all text children of an element.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(XMLElement) elem</td><td class=CDLDescription>A DOM element.</td></tr></table><h4 class=CHeading>Returns</h4><p>A String with the concatenated text of all text element children.</p></div></div></div>
57
58<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.copyElement"></a>copyElement</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>copyElement: function (</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Copy an XML DOM element.</p><p>This function copies a DOM element and all its descendants and returns the new copy.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(XMLElement) elem</td><td class=CDLDescription>A DOM element.</td></tr></table><h4 class=CHeading>Returns</h4><p>A new, copied DOM element tree.</p></div></div></div>
59
60<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.escapeNode"></a>escapeNode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>escapeNode: function (</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Escape the node part (also called local part) of a JID.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) node</td><td class=CDLDescription>A node (or local part).</td></tr></table><h4 class=CHeading>Returns</h4><p>An escaped node (or local part).</p></div></div></div>
61
62<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.unescapeNode"></a>unescapeNode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>unescapeNode: function (</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Unescape a node part (also called local part) of a JID.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) node</td><td class=CDLDescription>A node (or local part).</td></tr></table><h4 class=CHeading>Returns</h4><p>An unescaped node (or local part).</p></div></div></div>
63
64<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.getNodeFromJid"></a>getNodeFromJid</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getNodeFromJid: function (</td><td class=PParameter nowrap>jid</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get the node portion of a JID String.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) jid</td><td class=CDLDescription>A JID.</td></tr></table><h4 class=CHeading>Returns</h4><p>A String containing the node.</p></div></div></div>
65
66<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.getDomainFromJid"></a>getDomainFromJid</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getDomainFromJid: function (</td><td class=PParameter nowrap>jid</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get the domain portion of a JID String.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) jid</td><td class=CDLDescription>A JID.</td></tr></table><h4 class=CHeading>Returns</h4><p>A String containing the domain.</p></div></div></div>
67
68<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.getResourceFromJid"></a>getResourceFromJid</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getResourceFromJid: function (</td><td class=PParameter nowrap>jid</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get the resource portion of a JID String.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) jid</td><td class=CDLDescription>A JID.</td></tr></table><h4 class=CHeading>Returns</h4><p>A String containing the resource.</p></div></div></div>
69
70<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.getBareJidFromJid"></a>getBareJidFromJid</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getBareJidFromJid: function (</td><td class=PParameter nowrap>jid</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Get the bare JID from a JID String.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) jid</td><td class=CDLDescription>A JID.</td></tr></table><h4 class=CHeading>Returns</h4><p>A String containing the bare JID.</p></div></div></div>
71
72<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.log"></a>log</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>log: function (</td><td class=PParameter nowrap>level,</td></tr><tr><td></td><td class=PParameter nowrap>msg</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>User overrideable logging function.</p><p>This function is called whenever the Strophe library calls any of the logging functions.&nbsp;  The default implementation of this function does nothing.&nbsp;  If client code wishes to handle the logging messages, it should override this with</p><blockquote><pre>Strophe.log = function (level, msg) {
73  (user code here)
74};</pre></blockquote><p>Please note that data sent and received over the wire is logged via Strophe.Connection.rawInput() and Strophe.Connection.rawOutput().</p><p>The different levels and their meanings are</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>DEBUG</td><td class=CDLDescription>Messages useful for debugging purposes.</td></tr><tr><td class=CDLEntry>INFO</td><td class=CDLDescription>Informational messages.&nbsp;  This is mostly information like &lsquo;disconnect was called&rsquo; or &lsquo;SASL auth succeeded&rsquo;.</td></tr><tr><td class=CDLEntry>WARN</td><td class=CDLDescription>Warnings about potential problems.&nbsp;  This is mostly used to report transient connection errors like request timeouts.</td></tr><tr><td class=CDLEntry>ERROR</td><td class=CDLDescription>Some error occurred.</td></tr><tr><td class=CDLEntry>FATAL</td><td class=CDLDescription>A non-recoverable fatal error occurred.</td></tr></table><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(Integer) level</td><td class=CDLDescription>The log level of the log message.&nbsp;  This will be one of the values in Strophe.LogLevel.</td></tr><tr><td class=CDLEntry>(String) msg</td><td class=CDLDescription>The log message.</td></tr></table></div></div></div>
75
76<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.debug"></a>debug</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>debug: function(</td><td class=PParameter nowrap>msg</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Log a message at the Strophe.LogLevel.DEBUG level.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) msg</td><td class=CDLDescription>The log message.</td></tr></table></div></div></div>
77
78<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.info"></a>info</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>info: function (</td><td class=PParameter nowrap>msg</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Log a message at the Strophe.LogLevel.INFO level.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) msg</td><td class=CDLDescription>The log message.</td></tr></table></div></div></div>
79
80<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.warn"></a>warn</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>warn: function (</td><td class=PParameter nowrap>msg</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Log a message at the Strophe.LogLevel.WARN level.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) msg</td><td class=CDLDescription>The log message.</td></tr></table></div></div></div>
81
82<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.error"></a>error</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>error: function (</td><td class=PParameter nowrap>msg</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Log a message at the Strophe.LogLevel.ERROR level.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) msg</td><td class=CDLDescription>The log message.</td></tr></table></div></div></div>
83
84<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.fatal"></a>fatal</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>fatal: function (</td><td class=PParameter nowrap>msg</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Log a message at the Strophe.LogLevel.FATAL level.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) msg</td><td class=CDLDescription>The log message.</td></tr></table></div></div></div>
85
86<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.serialize"></a>serialize</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>serialize: function (</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Render a DOM element and all descendants to a String.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(XMLElement) elem</td><td class=CDLDescription>A DOM element.</td></tr></table><h4 class=CHeading>Returns</h4><p>The serialized element tree as a String.</p></div></div></div>
87
88<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.addConnectionPlugin"></a>addConnectionPlugin</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>addConnectionPlugin: function (</td><td class=PParameter nowrap>name,</td></tr><tr><td></td><td class=PParameter nowrap>ptype</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Extends the Strophe.Connection object with the given plugin.</p><h4 class=CHeading>Paramaters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) name</td><td class=CDLDescription>The name of the extension.</td></tr><tr><td class=CDLEntry>(Object) ptype</td><td class=CDLDescription>The plugin&rsquo;s prototype.</td></tr></table></div></div></div>
89
90<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="Strophe.Builder"></a>Strophe.<wbr>Builder</h2><div class=CBody><p>XML DOM builder.</p><p>This object provides an interface similar to JQuery but for building DOM element easily and rapidly.&nbsp;  All the functions except for toString() and tree() return the object, so calls can be chained.&nbsp;  Here&rsquo;s an example using the $iq() builder helper.</p><blockquote><pre>$iq({to: 'you': from: 'me': type: 'get', id: '1'})
91    .c('query', {xmlns: 'strophe:example'})
92    .c('example')
93    .toString()</pre></blockquote><p>The above generates this XML fragment</p><blockquote><pre>&lt;iq to='you' from='me' type='get' id='1'&gt;
94  &lt;query xmlns='strophe:example'&gt;
95    &lt;example/&gt;
96  &lt;/query&gt;
97&lt;/iq&gt;</pre></blockquote><p>The corresponding DOM manipulations to get a similar fragment would be a lot more tedious and probably involve several helper variables.</p><p>Since adding children makes new operations operate on the child, up() is provided to traverse up the tree.&nbsp;  To add two children, do</p><blockquote><pre>builder.c('child1', ...).up().c('child2', ...)</pre></blockquote><p>The next operation on the Builder will be relative to the second child.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#Strophe.Builder.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Builder.Strophe.Builder" id=link76 onMouseOver="ShowTip(event, 'tt27', 'link76')" onMouseOut="HideTip('tt27')">Strophe.<wbr>Builder</a></td><td class=SDescription>Create a Strophe.Builder object.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.Builder.tree" id=link77 onMouseOver="ShowTip(event, 'tt28', 'link77')" onMouseOut="HideTip('tt28')">tree</a></td><td class=SDescription>Return the DOM tree.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Builder.toString" id=link78 onMouseOver="ShowTip(event, 'tt29', 'link78')" onMouseOut="HideTip('tt29')">toString</a></td><td class=SDescription>Serialize the DOM tree to a String.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.Builder.up" id=link79 onMouseOver="ShowTip(event, 'tt30', 'link79')" onMouseOut="HideTip('tt30')">up</a></td><td class=SDescription>Make the current parent element the new current element.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Builder.attrs" id=link80 onMouseOver="ShowTip(event, 'tt31', 'link80')" onMouseOut="HideTip('tt31')">attrs</a></td><td class=SDescription>Add or modify attributes of the current element.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.Builder.c" id=link81 onMouseOver="ShowTip(event, 'tt32', 'link81')" onMouseOut="HideTip('tt32')">c</a></td><td class=SDescription>Add a child to the current element and make it the new current element.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Builder.cnode" id=link82 onMouseOver="ShowTip(event, 'tt33', 'link82')" onMouseOut="HideTip('tt33')">cnode</a></td><td class=SDescription>Add a child to the current element and make it the new current element.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.Builder.t" id=link83 onMouseOver="ShowTip(event, 'tt34', 'link83')" onMouseOut="HideTip('tt34')">t</a></td><td class=SDescription>Add a child text element.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
98
99<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.Builder.Functions"></a>Functions</h3></div></div>
100
101<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Builder.Strophe.Builder"></a>Strophe.<wbr>Builder</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>Strophe.Builder = function (</td><td class=PParameter nowrap>name,</td></tr><tr><td></td><td class=PParameter nowrap>attrs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Create a Strophe.Builder object.</p><p>The attributes should be passed in object notation.&nbsp;  For example</p><blockquote><pre>var b = new Builder('message', {to: 'you', from: 'me'});</pre></blockquote><p>or</p><blockquote><pre>var b = new Builder('messsage', {'xml:lang': 'en'});</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) name</td><td class=CDLDescription>The name of the root element.</td></tr><tr><td class=CDLEntry>(Object) attrs</td><td class=CDLDescription>The attributes for the root element in object notation.</td></tr></table><h4 class=CHeading>Returns</h4><p>A new Strophe.Builder.</p></div></div></div>
102
103<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Builder.tree"></a>tree</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>tree: function ()</td></tr></table></blockquote><p>Return the DOM tree.</p><p>This function returns the current DOM tree as an element object.&nbsp;  This is suitable for passing to functions like Strophe.Connection.send().</p><h4 class=CHeading>Returns</h4><p>The DOM tree as a element object.</p></div></div></div>
104
105<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Builder.toString"></a>toString</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>toString: function ()</td></tr></table></blockquote><p>Serialize the DOM tree to a String.</p><p>This function returns a string serialization of the current DOM tree.&nbsp;  It is often used internally to pass data to a Strophe.Request object.</p><h4 class=CHeading>Returns</h4><p>The serialized DOM tree in a String.</p></div></div></div>
106
107<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Builder.up"></a>up</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>up: function ()</td></tr></table></blockquote><p>Make the current parent element the new current element.</p><p>This function is often used after c() to traverse back up the tree.&nbsp; For example, to add two children to the same element</p><blockquote><pre>builder.c('child1', {}).up().c('child2', {});</pre></blockquote><h4 class=CHeading>Returns</h4><p>The Stophe.Builder object.</p></div></div></div>
108
109<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Builder.attrs"></a>attrs</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>attrs: function (</td><td class=PParameter nowrap>moreattrs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Add or modify attributes of the current element.</p><p>The attributes should be passed in object notation.&nbsp;  This function does not move the current element pointer.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(Object) moreattrs</td><td class=CDLDescription>The attributes to add/modify in object notation.</td></tr></table><h4 class=CHeading>Returns</h4><p>The Strophe.Builder object.</p></div></div></div>
110
111<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Builder.c"></a>c</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>c: function (</td><td class=PParameter nowrap>name,</td></tr><tr><td></td><td class=PParameter nowrap>attrs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Add a child to the current element and make it the new current element.</p><p>This function moves the current element pointer to the child.&nbsp;  If you need to add another child, it is necessary to use up() to go back to the parent in the tree.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) name</td><td class=CDLDescription>The name of the child.</td></tr><tr><td class=CDLEntry>(Object) attrs</td><td class=CDLDescription>The attributes of the child in object notation.</td></tr></table><h4 class=CHeading>Returns</h4><p>The Strophe.Builder object.</p></div></div></div>
112
113<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Builder.cnode"></a>cnode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>cnode: function (</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Add a child to the current element and make it the new current element.</p><p>This function is the same as c() except that instead of using a name and an attributes object to create the child it uses an existing DOM element object.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(XMLElement) elem</td><td class=CDLDescription>A DOM element.</td></tr></table><h4 class=CHeading>Returns</h4><p>The Strophe.Builder object.</p></div></div></div>
114
115<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Builder.t"></a>t</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>t: function (</td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Add a child text element.</p><p>This <b>does not</b> make the child the new current element since there are no children of text elements.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) text</td><td class=CDLDescription>The text data to append to the current element.</td></tr></table><h4 class=CHeading>Returns</h4><p>The Strophe.Builder object.</p></div></div></div>
116
117<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="Strophe.Connection"></a>Strophe.<wbr>Connection</h2><div class=CBody><p>XMPP Connection manager.</p><p>Thie class is the main part of Strophe.&nbsp;  It manages a BOSH connection to an XMPP server and dispatches events to the user callbacks as data arrives.&nbsp;  It supports SASL PLAIN, SASL DIGEST-MD5, and legacy authentication.</p><p>After creating a Strophe.Connection object, the user will typically call connect() with a user supplied callback to handle connection level events like authentication failure, disconnection, or connection complete.</p><p>The user will also have several event handlers defined by using addHandler() and addTimedHandler().&nbsp;  These will allow the user code to respond to interesting stanzas or do something periodically with the connection.&nbsp;  These handlers will be active once authentication is finished.</p><p>To send data to the connection, use send().</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#Strophe.Connection.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Connection.Strophe.Connection" id=link84 onMouseOver="ShowTip(event, 'tt35', 'link84')" onMouseOut="HideTip('tt35')">Strophe.<wbr>Connection</a></td><td class=SDescription>Create and initialize a Strophe.Connection object.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.Connection.reset" id=link85 onMouseOver="ShowTip(event, 'tt36', 'link85')" onMouseOut="HideTip('tt36')">reset</a></td><td class=SDescription>Reset the connection.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Connection.pause" id=link86 onMouseOver="ShowTip(event, 'tt37', 'link86')" onMouseOut="HideTip('tt37')">pause</a></td><td class=SDescription>Pause the request manager.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.Connection.resume" id=link87 onMouseOver="ShowTip(event, 'tt38', 'link87')" onMouseOut="HideTip('tt38')">resume</a></td><td class=SDescription>Resume the request manager.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Connection.getUniqueId" id=link88 onMouseOver="ShowTip(event, 'tt39', 'link88')" onMouseOut="HideTip('tt39')">getUniqueId</a></td><td class=SDescription>Generate a unique ID for use in &lt;iq/&gt; elements.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.Connection.connect" id=link89 onMouseOver="ShowTip(event, 'tt40', 'link89')" onMouseOut="HideTip('tt40')">connect</a></td><td class=SDescription>Starts the connection process.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Connection.attach" id=link90 onMouseOver="ShowTip(event, 'tt41', 'link90')" onMouseOut="HideTip('tt41')">attach</a></td><td class=SDescription>Attach to an already created and authenticated BOSH session.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.Connection.xmlInput" id=link91 onMouseOver="ShowTip(event, 'tt42', 'link91')" onMouseOut="HideTip('tt42')">xmlInput</a></td><td class=SDescription>User overrideable function that receives XML data coming into the connection.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Connection.xmlOutput" id=link92 onMouseOver="ShowTip(event, 'tt43', 'link92')" onMouseOut="HideTip('tt43')">xmlOutput</a></td><td class=SDescription>User overrideable function that receives XML data sent to the connection.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.Connection.rawInput" id=link93 onMouseOver="ShowTip(event, 'tt44', 'link93')" onMouseOut="HideTip('tt44')">rawInput</a></td><td class=SDescription>User overrideable function that receives raw data coming into the connection.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Connection.rawOutput" id=link94 onMouseOver="ShowTip(event, 'tt45', 'link94')" onMouseOut="HideTip('tt45')">rawOutput</a></td><td class=SDescription>User overrideable function that receives raw data sent to the connection.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.Connection.send" id=link95 onMouseOver="ShowTip(event, 'tt46', 'link95')" onMouseOut="HideTip('tt46')">send</a></td><td class=SDescription>Send a stanza.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Connection.flush" id=link96 onMouseOver="ShowTip(event, 'tt47', 'link96')" onMouseOut="HideTip('tt47')">flush</a></td><td class=SDescription>Immediately send any pending outgoing data.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.Connection.sendIQ" id=link97 onMouseOver="ShowTip(event, 'tt48', 'link97')" onMouseOut="HideTip('tt48')">sendIQ</a></td><td class=SDescription>Helper function to send IQ stanzas.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Connection.addTimedHandler" id=link98 onMouseOver="ShowTip(event, 'tt49', 'link98')" onMouseOut="HideTip('tt49')">addTimedHandler</a></td><td class=SDescription>Add a timed handler to the connection.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.Connection.deleteTimedHandler" id=link99 onMouseOver="ShowTip(event, 'tt50', 'link99')" onMouseOut="HideTip('tt50')">deleteTimedHandler</a></td><td class=SDescription>Delete a timed handler for a connection.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Connection.addHandler" id=link100 onMouseOver="ShowTip(event, 'tt51', 'link100')" onMouseOut="HideTip('tt51')">addHandler</a></td><td class=SDescription>Add a stanza handler for the connection.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.Connection.deleteHandler" id=link101 onMouseOver="ShowTip(event, 'tt52', 'link101')" onMouseOut="HideTip('tt52')">deleteHandler</a></td><td class=SDescription>Delete a stanza handler for a connection.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Connection.disconnect" id=link102 onMouseOver="ShowTip(event, 'tt53', 'link102')" onMouseOut="HideTip('tt53')">disconnect</a></td><td class=SDescription>Start the graceful disconnection process.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
118
119<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.Functions"></a>Functions</h3></div></div>
120
121<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.Strophe.Connection"></a>Strophe.<wbr>Connection</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>Strophe.Connection = function (</td><td class=PParameter nowrap>service</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Create and initialize a Strophe.Connection object.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) service</td><td class=CDLDescription>The BOSH service URL.</td></tr></table><h4 class=CHeading>Returns</h4><p>A new Strophe.Connection object.</p></div></div></div>
122
123<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.reset"></a>reset</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>reset: function ()</td></tr></table></blockquote><p>Reset the connection.</p><p>This function should be called after a connection is disconnected before that connection is reused.</p></div></div></div>
124
125<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.pause"></a>pause</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>pause: function ()</td></tr></table></blockquote><p>Pause the request manager.</p><p>This will prevent Strophe from sending any more requests to the server.&nbsp;  This is very useful for temporarily pausing while a lot of send() calls are happening quickly.&nbsp;  This causes Strophe to send the data in a single request, saving many request trips.</p></div></div></div>
126
127<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.resume"></a>resume</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>resume: function ()</td></tr></table></blockquote><p>Resume the request manager.</p><p>This resumes after pause() has been called.</p></div></div></div>
128
129<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.getUniqueId"></a>getUniqueId</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getUniqueId: function (</td><td class=PParameter nowrap>suffix</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Generate a unique ID for use in &lt;iq/&gt; elements.</p><p>All &lt;iq/&gt; stanzas are required to have unique id attributes.&nbsp;  This function makes creating these easy.&nbsp;  Each connection instance has a counter which starts from zero, and the value of this counter plus a colon followed by the suffix becomes the unique id.&nbsp; If no suffix is supplied, the counter is used as the unique id.</p><p>Suffixes are used to make debugging easier when reading the stream data, and their use is recommended.&nbsp;  The counter resets to 0 for every new connection for the same reason.&nbsp;  For connections to the same server that authenticate the same way, all the ids should be the same, which makes it easy to see changes.&nbsp;  This is useful for automated testing as well.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) suffix</td><td class=CDLDescription>A optional suffix to append to the id.</td></tr></table><h4 class=CHeading>Returns</h4><p>A unique string to be used for the id attribute.</p></div></div></div>
130
131<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.connect"></a>connect</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>connect: function (</td><td class=PParameter nowrap>jid,</td></tr><tr><td></td><td class=PParameter nowrap>pass,</td></tr><tr><td></td><td class=PParameter nowrap>callback,</td></tr><tr><td></td><td class=PParameter nowrap>wait,</td></tr><tr><td></td><td class=PParameter nowrap>hold</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Starts the connection process.</p><p>As the connection process proceeds, the user supplied callback will be triggered multiple times with status updates.&nbsp;  The callback should take two arguments - the status code and the error condition.</p><p>The status code will be one of the values in the Strophe.Status constants.&nbsp;  The error condition will be one of the conditions defined in RFC 3920 or the condition &lsquo;strophe-parsererror&rsquo;.</p><p>Please see XEP 124 for a more detailed explanation of the optional parameters below.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) jid</td><td class=CDLDescription>The user&rsquo;s JID.&nbsp;  This may be a bare JID, or a full JID.&nbsp;  If a node is not supplied, SASL ANONYMOUS authentication will be attempted.</td></tr><tr><td class=CDLEntry>(String) pass</td><td class=CDLDescription>The user&rsquo;s password.&nbsp; (Function) callback The connect callback function.</td></tr><tr><td class=CDLEntry>(Integer) wait</td><td class=CDLDescription>The optional HTTPBIND wait value.&nbsp;  This is the time the server will wait before returning an empty result for a request.&nbsp;  The default setting of 60 seconds is recommended.&nbsp; Other settings will require tweaks to the Strophe.TIMEOUT value.</td></tr><tr><td class=CDLEntry>(Integer) hold</td><td class=CDLDescription>The optional HTTPBIND hold value.&nbsp;  This is the number of connections the server will hold at one time.&nbsp;  This should almost always be set to 1 (the default).</td></tr></table></div></div></div>
132
133<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.attach"></a>attach</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>attach: function (</td><td class=PParameter nowrap>jid,</td></tr><tr><td></td><td class=PParameter nowrap>sid,</td></tr><tr><td></td><td class=PParameter nowrap>rid,</td></tr><tr><td></td><td class=PParameter nowrap>callback,</td></tr><tr><td></td><td class=PParameter nowrap>wait,</td></tr><tr><td></td><td class=PParameter nowrap>hold,</td></tr><tr><td></td><td class=PParameter nowrap>wind</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Attach to an already created and authenticated BOSH session.</p><p>This function is provided to allow Strophe to attach to BOSH sessions which have been created externally, perhaps by a Web application.&nbsp;  This is often used to support auto-login type features without putting user credentials into the page.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) jid</td><td class=CDLDescription>The full JID that is bound by the session.</td></tr><tr><td class=CDLEntry>(String) sid</td><td class=CDLDescription>The SID of the BOSH session.</td></tr><tr><td class=CDLEntry>(String) rid</td><td class=CDLDescription>The current RID of the BOSH session.&nbsp;  This RID will be used by the next request.&nbsp; (Function) callback The connect callback function.</td></tr><tr><td class=CDLEntry>(Integer) wait</td><td class=CDLDescription>The optional HTTPBIND wait value.&nbsp;  This is the time the server will wait before returning an empty result for a request.&nbsp;  The default setting of 60 seconds is recommended.&nbsp; Other settings will require tweaks to the Strophe.TIMEOUT value.</td></tr><tr><td class=CDLEntry>(Integer) hold</td><td class=CDLDescription>The optional HTTPBIND hold value.&nbsp;  This is the number of connections the server will hold at one time.&nbsp;  This should almost always be set to 1 (the default).</td></tr><tr><td class=CDLEntry>(Integer) wind</td><td class=CDLDescription>The optional HTTBIND window value.&nbsp;  This is the allowed range of request ids that are valid.&nbsp;  The default is 5.</td></tr></table></div></div></div>
134
135<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.xmlInput"></a>xmlInput</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>xmlInput: function (</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>User overrideable function that receives XML data coming into the connection.</p><p>The default function does nothing.&nbsp;  User code can override this with</p><blockquote><pre>Strophe.Connection.xmlInput = function (elem) {
136  (user code)
137};</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(XMLElement) elem</td><td class=CDLDescription>The XML data received by the connection.</td></tr></table></div></div></div>
138
139<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.xmlOutput"></a>xmlOutput</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>xmlOutput: function (</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>User overrideable function that receives XML data sent to the connection.</p><p>The default function does nothing.&nbsp;  User code can override this with</p><blockquote><pre>Strophe.Connection.xmlOutput = function (elem) {
140  (user code)
141};</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(XMLElement) elem</td><td class=CDLDescription>The XMLdata sent by the connection.</td></tr></table></div></div></div>
142
143<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.rawInput"></a>rawInput</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>rawInput: function (</td><td class=PParameter nowrap>data</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>User overrideable function that receives raw data coming into the connection.</p><p>The default function does nothing.&nbsp;  User code can override this with</p><blockquote><pre>Strophe.Connection.rawInput = function (data) {
144  (user code)
145};</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) data</td><td class=CDLDescription>The data received by the connection.</td></tr></table></div></div></div>
146
147<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.rawOutput"></a>rawOutput</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>rawOutput: function (</td><td class=PParameter nowrap>data</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>User overrideable function that receives raw data sent to the connection.</p><p>The default function does nothing.&nbsp;  User code can override this with</p><blockquote><pre>Strophe.Connection.rawOutput = function (data) {
148  (user code)
149};</pre></blockquote><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) data</td><td class=CDLDescription>The data sent by the connection.</td></tr></table></div></div></div>
150
151<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.send"></a>send</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>send: function (</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Send a stanza.</p><p>This function is called to push data onto the send queue to go out over the wire.&nbsp;  Whenever a request is sent to the BOSH server, all pending data is sent and the queue is flushed.</p><h4 class=CHeading>Parameters</h4><p>(XMLElement | [XMLElement] | Strophe.Builder) elem - The stanza to send.</p></div></div></div>
152
153<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.flush"></a>flush</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>flush: function ()</td></tr></table></blockquote><p>Immediately send any pending outgoing data.</p><p>Normally send() queues outgoing data until the next idle period (100ms), which optimizes network use in the common cases when several send()s are called in succession. flush() can be used to immediately send all pending data.</p></div></div></div>
154
155<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.sendIQ"></a>sendIQ</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>sendIQ: function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>callback,</td></tr><tr><td></td><td class=PParameter nowrap>errback,</td></tr><tr><td></td><td class=PParameter nowrap>timeout</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Helper function to send IQ stanzas.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(XMLElement) elem</td><td class=CDLDescription>The stanza to send.</td></tr><tr><td class=CDLEntry>(Function) callback</td><td class=CDLDescription>The callback function for a successful request.</td></tr><tr><td class=CDLEntry>(Function) errback</td><td class=CDLDescription>The callback function for a failed or timed out request.&nbsp;  On timeout, the stanza will be null.</td></tr><tr><td class=CDLEntry>(Integer) timeout</td><td class=CDLDescription>The time specified in milliseconds for a timeout to occur.</td></tr></table><h4 class=CHeading>Returns</h4><p>The id used to send the IQ.</p></div></div></div>
156
157<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.addTimedHandler"></a>addTimedHandler</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>addTimedHandler: function (</td><td class=PParameter nowrap>period,</td></tr><tr><td></td><td class=PParameter nowrap>handler</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Add a timed handler to the connection.</p><p>This function adds a timed handler.&nbsp;  The provided handler will be called every period milliseconds until it returns false, the connection is terminated, or the handler is removed.&nbsp;  Handlers that wish to continue being invoked should return true.</p><p>Because of method binding it is necessary to save the result of this function if you wish to remove a handler with deleteTimedHandler().</p><p>Note that user handlers are not active until authentication is successful.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(Integer) period</td><td class=CDLDescription>The period of the handler.</td></tr><tr><td class=CDLEntry>(Function) handler</td><td class=CDLDescription>The callback function.</td></tr></table><h4 class=CHeading>Returns</h4><p>A reference to the handler that can be used to remove it.</p></div></div></div>
158
159<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.deleteTimedHandler"></a>deleteTimedHandler</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>deleteTimedHandler: function (</td><td class=PParameter nowrap>handRef</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Delete a timed handler for a connection.</p><p>This function removes a timed handler from the connection.&nbsp; The handRef parameter is <b>not</b> the function passed to addTimedHandler(), but is the reference returned from addTimedHandler().</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(Strophe.TimedHandler) handRef</td><td class=CDLDescription>The handler reference.</td></tr></table></div></div></div>
160
161<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.addHandler"></a>addHandler</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>addHandler: function (</td><td class=PParameter nowrap>handler,</td></tr><tr><td></td><td class=PParameter nowrap>ns,</td></tr><tr><td></td><td class=PParameter nowrap>name,</td></tr><tr><td></td><td class=PParameter nowrap>type,</td></tr><tr><td></td><td class=PParameter nowrap>id,</td></tr><tr><td></td><td class=PParameter nowrap>from,</td></tr><tr><td></td><td class=PParameter nowrap>options</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Add a stanza handler for the connection.</p><p>This function adds a stanza handler to the connection.&nbsp;  The handler callback will be called for any stanza that matches the parameters.&nbsp;  Note that if multiple parameters are supplied, they must all match for the handler to be invoked.</p><p>The handler will receive the stanza that triggered it as its argument.&nbsp; The handler should return true if it is to be invoked again; returning false will remove the handler after it returns.</p><p>As a convenience, the ns parameters applies to the top level element and also any of its immediate children.&nbsp;  This is primarily to make matching /iq/query elements easy.</p><p>The options argument contains handler matching flags that affect how matches are determined.&nbsp; Currently the only flag is matchBare (a boolean).&nbsp; When matchBare is true, the from parameter and the from attribute on the stanza will be matched as bare JIDs instead of full JIDs.&nbsp; To use this, pass {matchBare: true} as the value of options.&nbsp; The default value for matchBare is false.</p><p>The return value should be saved if you wish to remove the handler with deleteHandler().</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(Function) handler</td><td class=CDLDescription>The user callback.</td></tr><tr><td class=CDLEntry>(String) ns</td><td class=CDLDescription>The namespace to match.</td></tr><tr><td class=CDLEntry>(String) name</td><td class=CDLDescription>The stanza name to match.</td></tr><tr><td class=CDLEntry>(String) type</td><td class=CDLDescription>The stanza type attribute to match.</td></tr><tr><td class=CDLEntry>(String) id</td><td class=CDLDescription>The stanza id attribute to match.</td></tr><tr><td class=CDLEntry>(String) from</td><td class=CDLDescription>The stanza from attribute to match.</td></tr><tr><td class=CDLEntry>(String) options</td><td class=CDLDescription>The handler options</td></tr></table><h4 class=CHeading>Returns</h4><p>A reference to the handler that can be used to remove it.</p></div></div></div>
162
163<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.deleteHandler"></a>deleteHandler</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>deleteHandler: function (</td><td class=PParameter nowrap>handRef</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Delete a stanza handler for a connection.</p><p>This function removes a stanza handler from the connection.&nbsp; The handRef parameter is <b>not</b> the function passed to addHandler(), but is the reference returned from addHandler().</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(Strophe.Handler) handRef</td><td class=CDLDescription>The handler reference.</td></tr></table></div></div></div>
164
165<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.disconnect"></a>disconnect</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>disconnect: function (</td><td class=PParameter nowrap>reason</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Start the graceful disconnection process.</p><p>This function starts the disconnection process.&nbsp;  This process starts by sending unavailable presence and sending BOSH body of type terminate.&nbsp;  A timeout handler makes sure that disconnection happens even if the BOSH server does not respond.</p><p>The user supplied connection callback will be notified of the progress as this process happens.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) reason</td><td class=CDLDescription>The reason the disconnect is occuring.</td></tr></table></div></div></div>
166
167</div><!--Content-->
168
169
170<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
171
172
173<div id=Menu><div class=MEntry><div class=MFile id=MSelected>js</div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Index</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MIndex><a href="../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Constants.html">Constants</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Files.html">Files</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Functions.html">Functions</a></div></div></div></div></div><script type="text/javascript"><!--
174var searchPanel = new SearchPanel("searchPanel", "HTML", "../search");
175--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Constants">Constants</option><option value="Files">Files</option><option value="Functions">Functions</option></select></div></div><!--Menu-->
176
177
178
179<!--START_ND_TOOLTIPS-->
180<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function $build(</td><td class=PParameter nowrap>name,</td></tr><tr><td></td><td class=PParameter nowrap>attrs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Create a Strophe.Builder. </div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function $msg(</td><td class=PParameter nowrap>attrs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Create a Strophe.Builder with a message/ element as the root.</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function $iq(</td><td class=PParameter nowrap>attrs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Create a Strophe.Builder with an iq/ element as the root.</div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function $pres(</td><td class=PParameter nowrap>attrs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Create a Strophe.Builder with a presence/ element as the root.</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>addNamespace: function (</td><td class=PParameter nowrap>name,</td></tr><tr><td></td><td class=PParameter nowrap>value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>This function is used to extend the current namespaces in Strophe.NS. </div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>forEachChild: function (</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>elemName,</td></tr><tr><td></td><td class=PParameter nowrap>func</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Map a function over some or all child elements of a given element.</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>isTagEqual: function (</td><td class=PParameter nowrap>el,</td></tr><tr><td></td><td class=PParameter nowrap>name</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Compare an element&rsquo;s tag name with a string.</div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>xmlElement: function (</td><td class=PParameter nowrap>name</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Create an XML DOM element.</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>xmlescape: function(</td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Excapes invalid xml characters.</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>xmlTextNode: function (</td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Creates an XML DOM text node.</div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getText: function (</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get the concatenation of all text children of an element.</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>copyElement: function (</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Copy an XML DOM element.</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>escapeNode: function (</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Escape the node part (also called local part) of a JID.</div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>unescapeNode: function (</td><td class=PParameter nowrap>node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Unescape a node part (also called local part) of a JID.</div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getNodeFromJid: function (</td><td class=PParameter nowrap>jid</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get the node portion of a JID String.</div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getDomainFromJid: function (</td><td class=PParameter nowrap>jid</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get the domain portion of a JID String.</div></div><div class=CToolTip id="tt17"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getResourceFromJid: function (</td><td class=PParameter nowrap>jid</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get the resource portion of a JID String.</div></div><div class=CToolTip id="tt18"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getBareJidFromJid: function (</td><td class=PParameter nowrap>jid</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Get the bare JID from a JID String.</div></div><div class=CToolTip id="tt19"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>log: function (</td><td class=PParameter nowrap>level,</td></tr><tr><td></td><td class=PParameter nowrap>msg</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>User overrideable logging function.</div></div><div class=CToolTip id="tt20"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>debug: function(</td><td class=PParameter nowrap>msg</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Log a message at the Strophe.LogLevel.DEBUG level.</div></div><div class=CToolTip id="tt21"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>info: function (</td><td class=PParameter nowrap>msg</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Log a message at the Strophe.LogLevel.INFO level.</div></div><div class=CToolTip id="tt22"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>warn: function (</td><td class=PParameter nowrap>msg</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Log a message at the Strophe.LogLevel.WARN level.</div></div><div class=CToolTip id="tt23"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>error: function (</td><td class=PParameter nowrap>msg</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Log a message at the Strophe.LogLevel.ERROR level.</div></div><div class=CToolTip id="tt24"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>fatal: function (</td><td class=PParameter nowrap>msg</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Log a message at the Strophe.LogLevel.FATAL level.</div></div><div class=CToolTip id="tt25"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>serialize: function (</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Render a DOM element and all descendants to a String.</div></div><div class=CToolTip id="tt26"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>addConnectionPlugin: function (</td><td class=PParameter nowrap>name,</td></tr><tr><td></td><td class=PParameter nowrap>ptype</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Extends the Strophe.Connection object with the given plugin.</div></div><div class=CToolTip id="tt27"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>Strophe.Builder = function (</td><td class=PParameter nowrap>name,</td></tr><tr><td></td><td class=PParameter nowrap>attrs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Create a Strophe.Builder object.</div></div><div class=CToolTip id="tt28"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>tree: function ()</td></tr></table></blockquote>Return the DOM tree.</div></div><div class=CToolTip id="tt29"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>toString: function ()</td></tr></table></blockquote>Serialize the DOM tree to a String.</div></div><div class=CToolTip id="tt30"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>up: function ()</td></tr></table></blockquote>Make the current parent element the new current element.</div></div><div class=CToolTip id="tt31"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>attrs: function (</td><td class=PParameter nowrap>moreattrs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Add or modify attributes of the current element.</div></div><div class=CToolTip id="tt32"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>c: function (</td><td class=PParameter nowrap>name,</td></tr><tr><td></td><td class=PParameter nowrap>attrs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Add a child to the current element and make it the new current element.</div></div><div class=CToolTip id="tt33"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>cnode: function (</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Add a child to the current element and make it the new current element.</div></div><div class=CToolTip id="tt34"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>t: function (</td><td class=PParameter nowrap>text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Add a child text element.</div></div><div class=CToolTip id="tt35"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>Strophe.Connection = function (</td><td class=PParameter nowrap>service</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Create and initialize a Strophe.Connection object.</div></div><div class=CToolTip id="tt36"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>reset: function ()</td></tr></table></blockquote>Reset the connection.</div></div><div class=CToolTip id="tt37"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>pause: function ()</td></tr></table></blockquote>Pause the request manager.</div></div><div class=CToolTip id="tt38"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>resume: function ()</td></tr></table></blockquote>Resume the request manager.</div></div><div class=CToolTip id="tt39"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>getUniqueId: function (</td><td class=PParameter nowrap>suffix</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Generate a unique ID for use in iq/ elements.</div></div><div class=CToolTip id="tt40"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>connect: function (</td><td class=PParameter nowrap>jid,</td></tr><tr><td></td><td class=PParameter nowrap>pass,</td></tr><tr><td></td><td class=PParameter nowrap>callback,</td></tr><tr><td></td><td class=PParameter nowrap>wait,</td></tr><tr><td></td><td class=PParameter nowrap>hold</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Starts the connection process.</div></div><div class=CToolTip id="tt41"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>attach: function (</td><td class=PParameter nowrap>jid,</td></tr><tr><td></td><td class=PParameter nowrap>sid,</td></tr><tr><td></td><td class=PParameter nowrap>rid,</td></tr><tr><td></td><td class=PParameter nowrap>callback,</td></tr><tr><td></td><td class=PParameter nowrap>wait,</td></tr><tr><td></td><td class=PParameter nowrap>hold,</td></tr><tr><td></td><td class=PParameter nowrap>wind</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Attach to an already created and authenticated BOSH session.</div></div><div class=CToolTip id="tt42"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>xmlInput: function (</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>User overrideable function that receives XML data coming into the connection.</div></div><div class=CToolTip id="tt43"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>xmlOutput: function (</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>User overrideable function that receives XML data sent to the connection.</div></div><div class=CToolTip id="tt44"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>rawInput: function (</td><td class=PParameter nowrap>data</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>User overrideable function that receives raw data coming into the connection.</div></div><div class=CToolTip id="tt45"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>rawOutput: function (</td><td class=PParameter nowrap>data</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>User overrideable function that receives raw data sent to the connection.</div></div><div class=CToolTip id="tt46"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>send: function (</td><td class=PParameter nowrap>elem</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Send a stanza.</div></div><div class=CToolTip id="tt47"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>flush: function ()</td></tr></table></blockquote>Immediately send any pending outgoing data.</div></div><div class=CToolTip id="tt48"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>sendIQ: function(</td><td class=PParameter nowrap>elem,</td></tr><tr><td></td><td class=PParameter nowrap>callback,</td></tr><tr><td></td><td class=PParameter nowrap>errback,</td></tr><tr><td></td><td class=PParameter nowrap>timeout</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Helper function to send IQ stanzas.</div></div><div class=CToolTip id="tt49"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>addTimedHandler: function (</td><td class=PParameter nowrap>period,</td></tr><tr><td></td><td class=PParameter nowrap>handler</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Add a timed handler to the connection.</div></div><div class=CToolTip id="tt50"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>deleteTimedHandler: function (</td><td class=PParameter nowrap>handRef</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Delete a timed handler for a connection.</div></div><div class=CToolTip id="tt51"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>addHandler: function (</td><td class=PParameter nowrap>handler,</td></tr><tr><td></td><td class=PParameter nowrap>ns,</td></tr><tr><td></td><td class=PParameter nowrap>name,</td></tr><tr><td></td><td class=PParameter nowrap>type,</td></tr><tr><td></td><td class=PParameter nowrap>id,</td></tr><tr><td></td><td class=PParameter nowrap>from,</td></tr><tr><td></td><td class=PParameter nowrap>options</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Add a stanza handler for the connection.</div></div><div class=CToolTip id="tt52"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>deleteHandler: function (</td><td class=PParameter nowrap>handRef</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Delete a stanza handler for a connection.</div></div><div class=CToolTip id="tt53"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>disconnect: function (</td><td class=PParameter nowrap>reason</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Start the graceful disconnection process.</div></div><!--END_ND_TOOLTIPS-->
181
182
183
184
185<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>
186
187
188<script language=JavaScript><!--
189if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>
Note: See TracBrowser for help on using the repository browser.