cirandas.net

ref: master

public/javascripts/vendor/strophejs-1.1.3/doc/files/strophe-js.html


  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><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/prettify.js"></script><script language=JavaScript src="../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.52 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<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/XMPP over Websocket.</p><p>This is the JavaScript version of the Strophe library.&nbsp;  Since JavaScript had 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><p>This version of Strophe also works with WebSockets.&nbsp; For more information on XMPP-over WebSocket see this RFC draft: <a href="http://tools.ietf.org/html/draft-ietf-xmpp-websocket-00" class=LURL target=_top>http://tools.ietf.org<wbr>/html<wbr>/draft-ietf-xmpp-websocket-00</a></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/XMPP over Websocket.</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="SConstant SIndent2 SMarked"><td class=SEntry><a href="#Strophe.XHTML_IM_Namespace" >XHTML_IM Namespace</a></td><td class=SDescription>contains allowed tags, tag attributes, and css properties. </td></tr><tr class="SConstant SIndent2"><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 SMarked"><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.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="SFunction SIndent2"><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 SMarked"><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"><td class=SEntry><a href="#Strophe.xmlGenerator" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">xmlGenerator</a></td><td class=SDescription>Get the DOM document to generate elements.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.xmlElement" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">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=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">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=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">xmlTextNode</a></td><td class=SDescription>Creates an XML DOM text node.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.xmlHtmlNode" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">xmlHtmlNode</a></td><td class=SDescription>Creates an XML DOM html node.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.getText" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">getText</a></td><td class=SDescription>Get the concatenation of all text children of an element.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.copyElement" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMouseOut="HideTip('tt14')">copyElement</a></td><td class=SDescription>Copy an XML DOM element.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.createHtml" id=link15 onMouseOver="ShowTip(event, 'tt15', 'link15')" onMouseOut="HideTip('tt15')">createHtml</a></td><td class=SDescription>Copy an HTML DOM element into an XML DOM.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.escapeNode" id=link16 onMouseOver="ShowTip(event, 'tt16', 'link16')" onMouseOut="HideTip('tt16')">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=link17 onMouseOver="ShowTip(event, 'tt17', 'link17')" onMouseOut="HideTip('tt17')">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=link18 onMouseOver="ShowTip(event, 'tt18', 'link18')" onMouseOut="HideTip('tt18')">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=link19 onMouseOver="ShowTip(event, 'tt19', 'link19')" onMouseOut="HideTip('tt19')">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=link20 onMouseOver="ShowTip(event, 'tt20', 'link20')" onMouseOut="HideTip('tt20')">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=link21 onMouseOver="ShowTip(event, 'tt21', 'link21')" onMouseOut="HideTip('tt21')">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" >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=link22 onMouseOver="ShowTip(event, 'tt22', 'link22')" onMouseOut="HideTip('tt22')">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=link23 onMouseOver="ShowTip(event, 'tt23', 'link23')" onMouseOut="HideTip('tt23')">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=link24 onMouseOver="ShowTip(event, 'tt24', 'link24')" onMouseOut="HideTip('tt24')">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=link25 onMouseOver="ShowTip(event, 'tt25', 'link25')" onMouseOut="HideTip('tt25')">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=link26 onMouseOver="ShowTip(event, 'tt26', 'link26')" onMouseOut="HideTip('tt26')">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=link27 onMouseOver="ShowTip(event, 'tt27', 'link27')" onMouseOut="HideTip('tt27')">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=link28 onMouseOver="ShowTip(event, 'tt28', 'link28')" onMouseOut="HideTip('tt28')">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=link29 onMouseOver="ShowTip(event, 'tt29', 'link29')" onMouseOut="HideTip('tt29')">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=link30 onMouseOver="ShowTip(event, 'tt30', 'link30')" onMouseOut="HideTip('tt30')">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=link31 onMouseOver="ShowTip(event, 'tt31', 'link31')" onMouseOut="HideTip('tt31')">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=link32 onMouseOver="ShowTip(event, 'tt32', 'link32')" onMouseOut="HideTip('tt32')">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=link33 onMouseOver="ShowTip(event, 'tt33', 'link33')" onMouseOut="HideTip('tt33')">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=link34 onMouseOver="ShowTip(event, 'tt34', 'link34')" onMouseOut="HideTip('tt34')">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=link35 onMouseOver="ShowTip(event, 'tt35', 'link35')" onMouseOut="HideTip('tt35')">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=link36 onMouseOver="ShowTip(event, 'tt36', 'link36')" onMouseOut="HideTip('tt36')">t</a></td><td class=SDescription>Add a child text element.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Builder.h" id=link37 onMouseOver="ShowTip(event, 'tt37', 'link37')" onMouseOut="HideTip('tt37')">h</a></td><td class=SDescription>Replace current element contents with the HTML passed in.</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=link38 onMouseOver="ShowTip(event, 'tt38', 'link38')" onMouseOut="HideTip('tt38')">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=link39 onMouseOver="ShowTip(event, 'tt39', 'link39')" onMouseOut="HideTip('tt39')">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=link40 onMouseOver="ShowTip(event, 'tt40', 'link40')" onMouseOut="HideTip('tt40')">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=link41 onMouseOver="ShowTip(event, 'tt41', 'link41')" onMouseOut="HideTip('tt41')">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=link42 onMouseOver="ShowTip(event, 'tt42', 'link42')" onMouseOut="HideTip('tt42')">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=link43 onMouseOver="ShowTip(event, 'tt43', 'link43')" onMouseOut="HideTip('tt43')">connect</a></td><td class=SDescription>Starts the connection process.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Strophe.Connection.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Connection.authzid" id=link44 onMouseOver="ShowTip(event, 'tt44', 'link44')" onMouseOut="HideTip('tt44')">authzid</a></td><td class=SDescription>Authorization identity.</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#Strophe.Connection.authcid" id=link45 onMouseOver="ShowTip(event, 'tt45', 'link45')" onMouseOut="HideTip('tt45')">authcid</a></td><td class=SDescription>Authentication identity (User name).</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Connection.pass" id=link46 onMouseOver="ShowTip(event, 'tt46', 'link46')" onMouseOut="HideTip('tt46')">pass</a></td><td class=SDescription>Authentication identity (User password).</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#Strophe.Connection.servtype" id=link47 onMouseOver="ShowTip(event, 'tt47', 'link47')" onMouseOut="HideTip('tt47')">servtype</a></td><td class=SDescription>Digest MD5 compatibility.</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.attach" id=link48 onMouseOver="ShowTip(event, 'tt48', 'link48')" onMouseOut="HideTip('tt48')">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" >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" >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" >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" >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=link49 onMouseOver="ShowTip(event, 'tt49', 'link49')" onMouseOut="HideTip('tt49')">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=link50 onMouseOver="ShowTip(event, 'tt50', 'link50')" onMouseOut="HideTip('tt50')">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=link51 onMouseOver="ShowTip(event, 'tt51', 'link51')" onMouseOut="HideTip('tt51')">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=link52 onMouseOver="ShowTip(event, 'tt52', 'link52')" onMouseOut="HideTip('tt52')">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=link53 onMouseOver="ShowTip(event, 'tt53', 'link53')" onMouseOut="HideTip('tt53')">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=link54 onMouseOver="ShowTip(event, 'tt54', 'link54')" onMouseOut="HideTip('tt54')">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=link55 onMouseOver="ShowTip(event, 'tt55', 'link55')" onMouseOut="HideTip('tt55')">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=link56 onMouseOver="ShowTip(event, 'tt56', 'link56')" onMouseOut="HideTip('tt56')">disconnect</a></td><td class=SDescription>Start the graceful disconnection process.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#Strophe.Connection.authenticate" id=link57 onMouseOver="ShowTip(event, 'tt57', 'link57')" onMouseOut="HideTip('tt57')">authenticate</a></td><td class=SDescription>Set up authentication</td></tr><tr class="SClass"><td class=SEntry><a href="#Strophe.SASLMechanism" >Strophe.<wbr>SASLMechanism</a></td><td class=SDescription>encapsulates SASL authentication mechanisms.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Strophe.SASLMechanism.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#Strophe.SASLMechanism.priority" id=link58 onMouseOver="ShowTip(event, 'tt58', 'link58')" onMouseOut="HideTip('tt58')">priority</a></td><td class=SDescription>Determines which <a href="#Strophe.SASLMechanism" class=LClass id=link59 onMouseOver="ShowTip(event, 'tt59', 'link59')" onMouseOut="HideTip('tt59')">SASLMechanism</a> is chosen for authentication (Higher is better). </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Strophe.SASLMechanism.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#Strophe.SASLMechanism.test" >test</a></td><td class=SDescription>Checks if mechanism able to run. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Strophe.SASLMechanism.Constants" >Constants</a></td><td class=SDescription></td></tr><tr class="SConstant SIndent2 SMarked"><td class=SEntry><a href="#Strophe.SASLMechanism.SASL_mechanisms" >SASL mechanisms</a></td><td class=SDescription>Available authentication mechanisms</td></tr><tr class="SClass"><td class=SEntry><a href="#Strophe.Bosh" >Strophe.Bosh</a></td><td class=SDescription><u>Private</u> helper class that handles BOSH Connections</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Strophe.Bosh.Files" >Files</a></td><td class=SDescription></td></tr><tr class="SFile SIndent2 SMarked"><td class=SEntry><a href="#bosh.js" >bosh.js</a></td><td class=SDescription>A JavaScript library to enable BOSH in Strophejs.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Strophe.Bosh.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#Strophe.Bosh.strip" id=link60 onMouseOver="ShowTip(event, 'tt60', 'link60')" onMouseOut="HideTip('tt60')">strip</a></td><td class=SDescription>BOSH-Connections will have all stanzas wrapped in a &lt;body&gt; tag when passed to <a href="#Strophe.Connection.xmlInput" class=LFunction id=link61 onMouseOver="ShowTip(event, 'tt61', 'link61')" onMouseOut="HideTip('tt61')">Strophe.Connection.xmlInput</a> or <a href="#Strophe.Connection.xmlOutput" class=LFunction id=link62 onMouseOver="ShowTip(event, 'tt62', 'link62')" onMouseOut="HideTip('tt62')">Strophe.Connection.xmlOutput</a>. </td></tr><tr class="SClass"><td class=SEntry><a href="#Strophe.WebSocket" >Strophe.<wbr>WebSocket</a></td><td class=SDescription><u>Private</u> helper class that handles WebSocket Connections</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Strophe.WebSocket.Files" >Files</a></td><td class=SDescription></td></tr><tr class="SFile SIndent2 SMarked"><td class=SEntry><a href="#websocket.js" >websocket.js</a></td><td class=SDescription>A JavaScript library to enable XMPP over Websocket in Strophejs.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Functions"></a>Functions</h3></div></div>

<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  prettyprint "nowrap>function $build(</td><td class="PParameter  prettyprint " nowrap>name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>attrs</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>function $msg(</td><td class="PParameter  prettyprint " nowrap>attrs</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>function $iq(</td><td class="PParameter  prettyprint " nowrap>attrs</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>function $pres(</td><td class="PParameter  prettyprint " nowrap>attrs</td><td class="PAfterParameters  prettyprint "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>

<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="SConstant SIndent1 SMarked"><td class=SEntry><a href="#Strophe.XHTML_IM_Namespace" >XHTML_IM Namespace</a></td><td class=SDescription>contains allowed tags, tag attributes, and css properties. </td></tr><tr class="SConstant SIndent1"><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 SMarked"><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.addNamespace" id=link63 onMouseOver="ShowTip(event, 'tt5', 'link63')" 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="SFunction SIndent1"><td class=SEntry><a href="#Strophe.forEachChild" id=link64 onMouseOver="ShowTip(event, 'tt6', 'link64')" 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 SMarked"><td class=SEntry><a href="#Strophe.isTagEqual" id=link65 onMouseOver="ShowTip(event, 'tt7', 'link65')" 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"><td class=SEntry><a href="#Strophe.xmlGenerator" id=link66 onMouseOver="ShowTip(event, 'tt8', 'link66')" onMouseOut="HideTip('tt8')">xmlGenerator</a></td><td class=SDescription>Get the DOM document to generate elements.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.xmlElement" id=link67 onMouseOver="ShowTip(event, 'tt9', 'link67')" onMouseOut="HideTip('tt9')">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=link68 onMouseOver="ShowTip(event, 'tt10', 'link68')" onMouseOut="HideTip('tt10')">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=link69 onMouseOver="ShowTip(event, 'tt11', 'link69')" onMouseOut="HideTip('tt11')">xmlTextNode</a></td><td class=SDescription>Creates an XML DOM text node.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.xmlHtmlNode" id=link70 onMouseOver="ShowTip(event, 'tt12', 'link70')" onMouseOut="HideTip('tt12')">xmlHtmlNode</a></td><td class=SDescription>Creates an XML DOM html node.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.getText" id=link71 onMouseOver="ShowTip(event, 'tt13', 'link71')" onMouseOut="HideTip('tt13')">getText</a></td><td class=SDescription>Get the concatenation of all text children of an element.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.copyElement" id=link72 onMouseOver="ShowTip(event, 'tt14', 'link72')" onMouseOut="HideTip('tt14')">copyElement</a></td><td class=SDescription>Copy an XML DOM element.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.createHtml" id=link73 onMouseOver="ShowTip(event, 'tt15', 'link73')" onMouseOut="HideTip('tt15')">createHtml</a></td><td class=SDescription>Copy an HTML DOM element into an XML DOM.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.escapeNode" id=link74 onMouseOver="ShowTip(event, 'tt16', 'link74')" onMouseOut="HideTip('tt16')">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=link75 onMouseOver="ShowTip(event, 'tt17', 'link75')" onMouseOut="HideTip('tt17')">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=link76 onMouseOver="ShowTip(event, 'tt18', 'link76')" onMouseOut="HideTip('tt18')">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=link77 onMouseOver="ShowTip(event, 'tt19', 'link77')" onMouseOut="HideTip('tt19')">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=link78 onMouseOver="ShowTip(event, 'tt20', 'link78')" onMouseOut="HideTip('tt20')">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=link79 onMouseOver="ShowTip(event, 'tt21', 'link79')" onMouseOut="HideTip('tt21')">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" >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=link80 onMouseOver="ShowTip(event, 'tt22', 'link80')" onMouseOut="HideTip('tt22')">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=link81 onMouseOver="ShowTip(event, 'tt23', 'link81')" onMouseOut="HideTip('tt23')">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=link82 onMouseOver="ShowTip(event, 'tt24', 'link82')" onMouseOut="HideTip('tt24')">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=link83 onMouseOver="ShowTip(event, 'tt25', 'link83')" onMouseOut="HideTip('tt25')">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=link84 onMouseOver="ShowTip(event, 'tt26', 'link84')" onMouseOut="HideTip('tt26')">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=link85 onMouseOver="ShowTip(event, 'tt27', 'link85')" onMouseOut="HideTip('tt27')">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=link86 onMouseOver="ShowTip(event, 'tt28', 'link86')" onMouseOut="HideTip('tt28')">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>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.Constants"></a>Constants</h3></div></div>

<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>

<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.NS.HTTPBIND"></a>NS.HTTPBIND</td><td class=CDLDescription>HTTP BIND namespace from XEP 124.</td></tr><tr><td class=CDLEntry><a name="Strophe.NS.BOSH"></a>NS.BOSH</td><td class=CDLDescription>BOSH namespace from XEP 206.</td></tr><tr><td class=CDLEntry><a name="Strophe.NS.CLIENT"></a>NS.CLIENT</td><td class=CDLDescription>Main XMPP client namespace.</td></tr><tr><td class=CDLEntry><a name="Strophe.NS.AUTH"></a>NS.AUTH</td><td class=CDLDescription>Legacy authentication namespace.</td></tr><tr><td class=CDLEntry><a name="Strophe.NS.ROSTER"></a>NS.ROSTER</td><td class=CDLDescription>Roster operations namespace.</td></tr><tr><td class=CDLEntry><a name="Strophe.NS.PROFILE"></a>NS.PROFILE</td><td class=CDLDescription>Profile namespace.</td></tr><tr><td class=CDLEntry><a name="Strophe.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.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.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.NS.SASL"></a>NS.SASL</td><td class=CDLDescription>XMPP SASL namespace from RFC 3920.</td></tr><tr><td class=CDLEntry><a name="Strophe.NS.STREAM"></a>NS.STREAM</td><td class=CDLDescription>XMPP Streams namespace from RFC 3920.</td></tr><tr><td class=CDLEntry><a name="Strophe.NS.BIND"></a>NS.BIND</td><td class=CDLDescription>XMPP Binding namespace from RFC 3920.</td></tr><tr><td class=CDLEntry><a name="Strophe.NS.SESSION"></a>NS.SESSION</td><td class=CDLDescription>XMPP Session namespace from RFC 3920.</td></tr><tr><td class=CDLEntry><a name="Strophe.NS.XHTML_IM"></a>NS.XHTML_IM</td><td class=CDLDescription>XHTML-IM namespace from XEP 71.</td></tr><tr><td class=CDLEntry><a name="Strophe.NS.XHTML"></a>NS.XHTML</td><td class=CDLDescription>XHTML body namespace from XEP 71.</td></tr></table></div></div></div>

<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="Strophe.XHTML_IM_Namespace"></a>XHTML_IM Namespace</h3><div class=CBody><p>contains allowed tags, tag attributes, and css properties.&nbsp; Used in the createHtml function to filter incoming html into the allowed XHTML-IM subset.&nbsp; See <a href="http://xmpp.org/extensions/xep-0071.html#profile-summary" class=LURL target=_top>http://xmpp.org<wbr>/extensions<wbr>/xep-0071.html#profile-summary</a> for the list of recommended allowed tags and their attributes.</p></div></div></div>

<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.Status.ERROR"></a>Status.ERROR</td><td class=CDLDescription>An error has occurred</td></tr><tr><td class=CDLEntry><a name="Strophe.Status.CONNECTING"></a>Status.CONNECTING</td><td class=CDLDescription>The connection is currently being made</td></tr><tr><td class=CDLEntry><a name="Strophe.Status.CONNFAIL"></a>Status.CONNFAIL</td><td class=CDLDescription>The connection attempt failed</td></tr><tr><td class=CDLEntry><a name="Strophe.Status.AUTHENTICATING"></a>Status.AUTHENTICATING</td><td class=CDLDescription>The connection is authenticating</td></tr><tr><td class=CDLEntry><a name="Strophe.Status.AUTHFAIL"></a>Status.AUTHFAIL</td><td class=CDLDescription>The authentication attempt failed</td></tr><tr><td class=CDLEntry><a name="Strophe.Status.CONNECTED"></a>Status.CONNECTED</td><td class=CDLDescription>The connection has succeeded</td></tr><tr><td class=CDLEntry><a name="Strophe.Status.DISCONNECTED"></a>Status.DISCONNECTED</td><td class=CDLDescription>The connection has been terminated</td></tr><tr><td class=CDLEntry><a name="Strophe.Status.DISCONNECTING"></a>Status.DISCONNECTING</td><td class=CDLDescription>The connection is currently being terminated</td></tr><tr><td class=CDLEntry><a name="Strophe.Status.ATTACHED"></a>Status.ATTACHED</td><td class=CDLDescription>The connection has been attached</td></tr></table></div></div></div>

<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.LogLevel.DEBUG"></a>LogLevel.DEBUG</td><td class=CDLDescription>Debug output</td></tr><tr><td class=CDLEntry><a name="Strophe.LogLevel.INFO"></a>LogLevel.INFO</td><td class=CDLDescription>Informational output</td></tr><tr><td class=CDLEntry><a name="Strophe.LogLevel.WARN"></a>LogLevel.WARN</td><td class=CDLDescription>Warnings</td></tr><tr><td class=CDLEntry><a name="Strophe.LogLevel.ERROR"></a>LogLevel.ERROR</td><td class=CDLDescription>Errors</td></tr><tr><td class=CDLEntry><a name="Strophe.LogLevel.FATAL"></a>LogLevel.FATAL</td><td class=CDLDescription>Fatal errors</td></tr></table></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.Functions"></a>Functions</h3></div></div>

<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  prettyprint "nowrap>addNamespace: function (</td><td class="PParameter  prettyprint " nowrap>name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>value</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>forEachChild: function (</td><td class="PParameter  prettyprint " nowrap>elem,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>elemName,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>func</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>isTagEqual: function (</td><td class="PParameter  prettyprint " nowrap>el,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>name</td><td class="PAfterParameters  prettyprint "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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.xmlGenerator"></a>xmlGenerator</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">xmlGenerator: function ()</td></tr></table></blockquote><p>Get the DOM document to generate elements.</p><h4 class=CHeading>Returns</h4><p>The currently used DOM document.</p></div></div></div>

<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  prettyprint "nowrap>xmlElement: function (</td><td class="PParameter  prettyprint " nowrap>name</td><td class="PAfterParameters  prettyprint "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; Note that these are not HTML DOM elements, which aren&rsquo;t appropriate for XMPP stanzas.</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|Object) attrs</td><td class=CDLDescription>An optional array or object containing key/value pairs to use as element attributes.&nbsp; The object should be in the format {&lsquo;key&rsquo;: &lsquo;value&rsquo;} or {key: &lsquo;value&rsquo;}.&nbsp; The array should have the 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>

<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  prettyprint "nowrap>xmlescape: function(</td><td class="PParameter  prettyprint " nowrap>text</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>xmlTextNode: function (</td><td class="PParameter  prettyprint " nowrap>text</td><td class="PAfterParameters  prettyprint "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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.xmlHtmlNode"></a>xmlHtmlNode</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  prettyprint "nowrap>xmlHtmlNode: function (</td><td class="PParameter  prettyprint " nowrap>html</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates an XML DOM html node.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) html</td><td class=CDLDescription>The content of the html node.</td></tr></table><h4 class=CHeading>Returns</h4><p>A new XML DOM text node.</p></div></div></div>

<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  prettyprint "nowrap>getText: function (</td><td class="PParameter  prettyprint " nowrap>elem</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>copyElement: function (</td><td class="PParameter  prettyprint " nowrap>elem</td><td class="PAfterParameters  prettyprint "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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.createHtml"></a>createHtml</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  prettyprint "nowrap>createHtml: function (</td><td class="PParameter  prettyprint " nowrap>elem</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Copy an HTML DOM element into an XML DOM.</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>(HTMLElement) 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>

<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  prettyprint "nowrap>escapeNode: function (</td><td class="PParameter  prettyprint " nowrap>node</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>unescapeNode: function (</td><td class="PParameter  prettyprint " nowrap>node</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>getNodeFromJid: function (</td><td class="PParameter  prettyprint " nowrap>jid</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>getDomainFromJid: function (</td><td class="PParameter  prettyprint " nowrap>jid</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>getResourceFromJid: function (</td><td class="PParameter  prettyprint " nowrap>jid</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>getBareJidFromJid: function (</td><td class="PParameter  prettyprint " nowrap>jid</td><td class="PAfterParameters  prettyprint "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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.log"></a>log</h3><div class=CBody><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) {
  (user code here)
};</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>

<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  prettyprint "nowrap>debug: function(</td><td class="PParameter  prettyprint " nowrap>msg</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>info: function (</td><td class="PParameter  prettyprint " nowrap>msg</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>warn: function (</td><td class="PParameter  prettyprint " nowrap>msg</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>error: function (</td><td class="PParameter  prettyprint " nowrap>msg</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>fatal: function (</td><td class="PParameter  prettyprint " nowrap>msg</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>serialize: function (</td><td class="PParameter  prettyprint " nowrap>elem</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>addConnectionPlugin: function (</td><td class="PParameter  prettyprint " nowrap>name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ptype</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Extends the Strophe.Connection object with the given plugin.</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 extension.</td></tr><tr><td class=CDLEntry>(Object) ptype</td><td class=CDLDescription>The plugin&rsquo;s prototype.</td></tr></table></div></div></div>

<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'})
    .c('query', {xmlns: 'strophe:example'})
    .c('example')
    .toString()</pre></blockquote><p>The above generates this XML fragment</p><blockquote><pre>&lt;iq to='you' from='me' type='get' id='1'&gt;
  &lt;query xmlns='strophe:example'&gt;
    &lt;example/&gt;
  &lt;/query&gt;
&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=link87 onMouseOver="ShowTip(event, 'tt29', 'link87')" onMouseOut="HideTip('tt29')">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=link88 onMouseOver="ShowTip(event, 'tt30', 'link88')" onMouseOut="HideTip('tt30')">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=link89 onMouseOver="ShowTip(event, 'tt31', 'link89')" onMouseOut="HideTip('tt31')">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=link90 onMouseOver="ShowTip(event, 'tt32', 'link90')" onMouseOut="HideTip('tt32')">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=link91 onMouseOver="ShowTip(event, 'tt33', 'link91')" onMouseOut="HideTip('tt33')">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=link92 onMouseOver="ShowTip(event, 'tt34', 'link92')" onMouseOut="HideTip('tt34')">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=link93 onMouseOver="ShowTip(event, 'tt35', 'link93')" onMouseOut="HideTip('tt35')">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=link94 onMouseOver="ShowTip(event, 'tt36', 'link94')" onMouseOut="HideTip('tt36')">t</a></td><td class=SDescription>Add a child text element.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Builder.h" id=link95 onMouseOver="ShowTip(event, 'tt37', 'link95')" onMouseOut="HideTip('tt37')">h</a></td><td class=SDescription>Replace current element contents with the HTML passed in.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.Builder.Functions"></a>Functions</h3></div></div>

<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  prettyprint "nowrap>Strophe.Builder = function (</td><td class="PParameter  prettyprint " nowrap>name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>attrs</td><td class="PAfterParameters  prettyprint "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>

<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 class="prettyprint">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>

<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 class="prettyprint">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>

<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 class="prettyprint">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>

<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  prettyprint "nowrap>attrs: function (</td><td class="PParameter  prettyprint " nowrap>moreattrs</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>c: function (</td><td class="PParameter  prettyprint " nowrap>name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>attrs,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>text</td><td class="PAfterParameters  prettyprint "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, unless text is provided.&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><tr><td class=CDLEntry>(String) text</td><td class=CDLDescription>The text to add to the child.</td></tr></table><h4 class=CHeading>Returns</h4><p>The Strophe.Builder object.</p></div></div></div>

<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  prettyprint "nowrap>cnode: function (</td><td class="PParameter  prettyprint " nowrap>elem</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>t: function (</td><td class="PParameter  prettyprint " nowrap>text</td><td class="PAfterParameters  prettyprint "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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Builder.h"></a>h</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  prettyprint "nowrap>h: function (</td><td class="PParameter  prettyprint " nowrap>html</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Replace current element contents with the HTML passed in.</p><p>This <b>does not</b> make the child the new current element</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(String) html</td><td class=CDLDescription>The html to insert as contents of current element.</td></tr></table><h4 class=CHeading>Returns</h4><p>The Strophe.Builder object.</p></div></div></div>

<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>This 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, SASL SCRAM-SHA1 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=link96 onMouseOver="ShowTip(event, 'tt38', 'link96')" onMouseOut="HideTip('tt38')">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=link97 onMouseOver="ShowTip(event, 'tt39', 'link97')" onMouseOut="HideTip('tt39')">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=link98 onMouseOver="ShowTip(event, 'tt40', 'link98')" onMouseOut="HideTip('tt40')">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=link99 onMouseOver="ShowTip(event, 'tt41', 'link99')" onMouseOut="HideTip('tt41')">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=link100 onMouseOver="ShowTip(event, 'tt42', 'link100')" onMouseOut="HideTip('tt42')">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=link101 onMouseOver="ShowTip(event, 'tt43', 'link101')" onMouseOut="HideTip('tt43')">connect</a></td><td class=SDescription>Starts the connection process.</td></tr><tr class="SGroup"><td class=SEntry><a href="#Strophe.Connection.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Connection.authzid" id=link102 onMouseOver="ShowTip(event, 'tt44', 'link102')" onMouseOut="HideTip('tt44')">authzid</a></td><td class=SDescription>Authorization identity.</td></tr><tr class="SVariable SIndent1"><td class=SEntry><a href="#Strophe.Connection.authcid" id=link103 onMouseOver="ShowTip(event, 'tt45', 'link103')" onMouseOut="HideTip('tt45')">authcid</a></td><td class=SDescription>Authentication identity (User name).</td></tr><tr class="SVariable SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Connection.pass" id=link104 onMouseOver="ShowTip(event, 'tt46', 'link104')" onMouseOut="HideTip('tt46')">pass</a></td><td class=SDescription>Authentication identity (User password).</td></tr><tr class="SVariable SIndent1"><td class=SEntry><a href="#Strophe.Connection.servtype" id=link105 onMouseOver="ShowTip(event, 'tt47', 'link105')" onMouseOut="HideTip('tt47')">servtype</a></td><td class=SDescription>Digest MD5 compatibility.</td></tr><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.attach" id=link106 onMouseOver="ShowTip(event, 'tt48', 'link106')" onMouseOut="HideTip('tt48')">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" >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" >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" >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" >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=link107 onMouseOver="ShowTip(event, 'tt49', 'link107')" onMouseOut="HideTip('tt49')">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=link108 onMouseOver="ShowTip(event, 'tt50', 'link108')" onMouseOut="HideTip('tt50')">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=link109 onMouseOver="ShowTip(event, 'tt51', 'link109')" onMouseOut="HideTip('tt51')">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=link110 onMouseOver="ShowTip(event, 'tt52', 'link110')" onMouseOut="HideTip('tt52')">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=link111 onMouseOver="ShowTip(event, 'tt53', 'link111')" onMouseOut="HideTip('tt53')">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=link112 onMouseOver="ShowTip(event, 'tt54', 'link112')" onMouseOut="HideTip('tt54')">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=link113 onMouseOver="ShowTip(event, 'tt55', 'link113')" onMouseOut="HideTip('tt55')">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=link114 onMouseOver="ShowTip(event, 'tt56', 'link114')" onMouseOut="HideTip('tt56')">disconnect</a></td><td class=SDescription>Start the graceful disconnection process.</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#Strophe.Connection.authenticate" id=link115 onMouseOver="ShowTip(event, 'tt57', 'link115')" onMouseOut="HideTip('tt57')">authenticate</a></td><td class=SDescription>Set up authentication</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.Functions"></a>Functions</h3></div></div>

<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  prettyprint "nowrap>Strophe.Connection = function (</td><td class="PParameter  prettyprint " nowrap>service,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>options</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Create and initialize a Strophe.Connection object.</p><p>The transport-protocol for this connection will be chosen automatically based on the given service parameter.&nbsp; URLs starting with &ldquo;ws://&rdquo; or &ldquo;wss://&rdquo; will use WebSockets, URLs starting with &ldquo;<a href="http://" class=LURL target=_top>http://</a>&rdquo;, &ldquo;<a href="https://" class=LURL target=_top>https://</a>&rdquo; or without a protocol will use BOSH.</p><p>To make Strophe connect to the current host you can leave out the protocol and host part and just pass the path, e.g.</p><blockquote><pre>var conn = new Strophe.Connection(&quot;/http-bind/&quot;);</pre></blockquote><h4 class=CHeading>WebSocket options</h4><p>If you want to connect to the current host with a WebSocket connection you can tell Strophe to use WebSockets through a &ldquo;protocol&rdquo; attribute in the optional options parameter.&nbsp; Valid values are &ldquo;ws&rdquo; for WebSocket and &ldquo;wss&rdquo; for Secure WebSocket.&nbsp; So to connect to &ldquo;wss://CURRENT_HOSTNAME/xmpp-websocket&rdquo; you would call</p><blockquote><pre>var conn = new Strophe.Connection(&quot;/xmpp-websocket/&quot;, {protocol: &quot;wss&quot;});</pre></blockquote><p>Note that relative URLs <u>NOT</u> starting with a &ldquo;/&rdquo; will also include the path of the current site.</p><p>Also because downgrading security is not permitted by browsers, when using relative URLs both BOSH and WebSocket connections will use their secure variants if the current connection to the site is also secure (https).</p><h4 class=CHeading>BOSH options</h4><p>by adding &ldquo;sync&rdquo; to the options, you can control if requests will be made synchronously or not.&nbsp; The default behaviour is asynchronous.&nbsp; If you want to make requests synchronous, make &ldquo;sync&rdquo; evaluate to true:</p><blockquote><pre>var conn = new Strophe.Connection(&quot;/http-bind/&quot;, {sync: true});</pre></blockquote><p>You can also toggle this on an already established connection:</p><blockquote><pre>conn.options.sync = true;</pre></blockquote><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 or WebSocket service URL.</td></tr><tr><td class=CDLEntry>(Object) options</td><td class=CDLDescription>A hash of configuration options</td></tr></table><h4 class=CHeading>Returns</h4><p>A new Strophe.Connection object.</p></div></div></div>

<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 class="prettyprint">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>

<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 class="prettyprint">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 BOSH-Connections 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>

<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 class="prettyprint">resume: function ()</td></tr></table></blockquote><p>Resume the request manager.</p><p>This resumes after pause() has been called.</p></div></div></div>

<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  prettyprint "nowrap>getUniqueId: function (</td><td class="PParameter  prettyprint " nowrap>suffix</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>connect: function (</td><td class="PParameter  prettyprint " nowrap>jid,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>pass,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>callback,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>wait,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>hold,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>route</td><td class="PAfterParameters  prettyprint "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>The Parameters <u>wait</u>, <u>hold</u> and <u>route</u> are optional and only relevant for BOSH connections.&nbsp; Please see XEP 124 for a more detailed explanation of the optional parameters.</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.</td></tr><tr><td class=CDLEntry>(Function) callback</td><td class=CDLDescription>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.</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>(String) route</td><td class=CDLDescription>The optional route value.</td></tr></table></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.Variables"></a>Variables</h3></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.authzid"></a>authzid</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.authzid</td></tr></table></blockquote><p>Authorization identity.</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.authcid"></a>authcid</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.authcid</td></tr></table></blockquote><p>Authentication identity (User name).</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.pass"></a>pass</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.pass</td></tr></table></blockquote><p>Authentication identity (User password).</p></div></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.servtype"></a>servtype</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.servtype</td></tr></table></blockquote><p>Digest MD5 compatibility.</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.Functions"></a>Functions</h3></div></div>

<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  prettyprint "nowrap>attach: function (</td><td class="PParameter  prettyprint " nowrap>jid,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>sid,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>rid,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>callback,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>wait,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>hold,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>wind</td><td class="PAfterParameters  prettyprint "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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.xmlInput"></a>xmlInput</h3><div class=CBody><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) {
  (user code)
};</pre></blockquote><p>Due to limitations of current Browsers&rsquo; XML-Parsers the opening and closing &lt;stream&gt; tag for WebSocket-Connoctions will be passed as selfclosing here.</p><p>BOSH-Connections will have all stanzas wrapped in a &lt;body&gt; tag.&nbsp; See <a href="#Strophe.Bosh.strip" class=LVariable id=link116 onMouseOver="ShowTip(event, 'tt60', 'link116')" onMouseOut="HideTip('tt60')">Strophe.Bosh.strip</a> if you want to strip this tag.</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 XML data received by the connection.</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.xmlOutput"></a>xmlOutput</h3><div class=CBody><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) {
  (user code)
};</pre></blockquote><p>Due to limitations of current Browsers&rsquo; XML-Parsers the opening and closing &lt;stream&gt; tag for WebSocket-Connoctions will be passed as selfclosing here.</p><p>BOSH-Connections will have all stanzas wrapped in a &lt;body&gt; tag.&nbsp; See <a href="#Strophe.Bosh.strip" class=LVariable id=link117 onMouseOver="ShowTip(event, 'tt60', 'link117')" onMouseOut="HideTip('tt60')">Strophe.Bosh.strip</a> if you want to strip this tag.</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 XMLdata sent by the connection.</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.rawInput"></a>rawInput</h3><div class=CBody><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) {
  (user code)
};</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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.rawOutput"></a>rawOutput</h3><div class=CBody><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) {
  (user code)
};</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>

<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  prettyprint "nowrap>send: function (</td><td class="PParameter  prettyprint " nowrap>elem</td><td class="PAfterParameters  prettyprint "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>

<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 class="prettyprint">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>

<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  prettyprint "nowrap>sendIQ: function(</td><td class="PParameter  prettyprint " nowrap>elem,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>callback,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>errback,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>timeout</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>addTimedHandler: function (</td><td class="PParameter  prettyprint " nowrap>period,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>handler</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>deleteTimedHandler: function (</td><td class="PParameter  prettyprint " nowrap>handRef</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>addHandler: function (</td><td class="PParameter  prettyprint " nowrap>handler,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ns,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>type,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>id,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>from,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>options</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>deleteHandler: function (</td><td class="PParameter  prettyprint " nowrap>handRef</td><td class="PAfterParameters  prettyprint "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>

<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  prettyprint "nowrap>disconnect: function (</td><td class="PParameter  prettyprint " nowrap>reason</td><td class="PAfterParameters  prettyprint "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>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.Connection.authenticate"></a>authenticate</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  prettyprint "nowrap>authenticate: function (</td><td class="PParameter  prettyprint " nowrap>matched</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Set up authentication</p><p>Contiunues the initial connection request by setting up authentication handlers and start the authentication process.</p><p>SASL authentication will be attempted if available, otherwise the code will fall back to legacy authentication.</p></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="Strophe.SASLMechanism"></a>Strophe.<wbr>SASLMechanism</h2><div class=CBody><p>encapsulates SASL authentication mechanisms.</p><p>User code may override the priority for each mechanism or disable it completely.&nbsp; See <a href="#Strophe.SASLMechanism.priority" class=LVariable id=link120 onMouseOver="ShowTip(event, 'tt58', 'link120')" onMouseOut="HideTip('tt58')">priority</a> for information about changing priority and <a href="#Strophe.SASLMechanism.test" class=LFunction id=link121 onMouseOver="ShowTip(event, 'tt63', 'link121')" onMouseOut="HideTip('tt63')">test</a> for informatian on how to disable a mechanism.</p><p>By default, all mechanisms are enabled and the priorities are</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>SCRAM-SHA1</td><td class=CDLDescription>40</td></tr><tr><td class=CDLEntry>DIGEST-MD5</td><td class=CDLDescription>30</td></tr><tr><td class=CDLEntry>Plain</td><td class=CDLDescription>20</td></tr></table><!--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.SASLMechanism.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent1 SMarked"><td class=SEntry><a href="#Strophe.SASLMechanism.priority" id=link118 onMouseOver="ShowTip(event, 'tt58', 'link118')" onMouseOut="HideTip('tt58')">priority</a></td><td class=SDescription>Determines which <a href="#Strophe.SASLMechanism" class=LClass id=link119 onMouseOver="ShowTip(event, 'tt59', 'link119')" onMouseOut="HideTip('tt59')">SASLMechanism</a> is chosen for authentication (Higher is better). </td></tr><tr class="SGroup"><td class=SEntry><a href="#Strophe.SASLMechanism.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#Strophe.SASLMechanism.test" >test</a></td><td class=SDescription>Checks if mechanism able to run. </td></tr><tr class="SGroup"><td class=SEntry><a href="#Strophe.SASLMechanism.Constants" >Constants</a></td><td class=SDescription></td></tr><tr class="SConstant SIndent1 SMarked"><td class=SEntry><a href="#Strophe.SASLMechanism.SASL_mechanisms" >SASL mechanisms</a></td><td class=SDescription>Available authentication mechanisms</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.SASLMechanism.Variables"></a>Variables</h3></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="Strophe.SASLMechanism.priority"></a>priority</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.priority</td></tr></table></blockquote><p>Determines which <a href="#Strophe.SASLMechanism" class=LClass id=link122 onMouseOver="ShowTip(event, 'tt59', 'link122')" onMouseOut="HideTip('tt59')">SASLMechanism</a> is chosen for authentication (Higher is better).&nbsp; Users may override this to prioritize mechanisms differently.</p><p>In the default configuration the priorities are</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>SCRAM-SHA1</td><td class=CDLDescription>40</td></tr><tr><td class=CDLEntry>DIGEST-MD5</td><td class=CDLDescription>30</td></tr><tr><td class=CDLEntry>Plain</td><td class=CDLDescription>20</td></tr></table><p>Example: (This will cause Strophe to choose the mechanism that the server sent first)</p><blockquote><pre>Strophe.SASLMD5.priority = Strophe.SASLSHA1.priority;</pre></blockquote><p>See <a href="#Strophe.SASLMechanism.SASL_mechanisms" class=LConstant id=link123 onMouseOver="ShowTip(event, 'tt64', 'link123')" onMouseOut="HideTip('tt64')">SASL mechanisms</a> for a list of available mechanisms.</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.SASLMechanism.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="Strophe.SASLMechanism.test"></a>test</h3><div class=CBody><p>Checks if mechanism able to run.&nbsp; To disable a mechanism, make this return false;</p><p>To disable plain authentication run</p><blockquote><pre>Strophe.SASLPlain.test = function() {
  return false;
}</pre></blockquote><p>See <a href="#Strophe.SASLMechanism.SASL_mechanisms" class=LConstant id=link124 onMouseOver="ShowTip(event, 'tt64', 'link124')" onMouseOut="HideTip('tt64')">SASL mechanisms</a> for a list of available mechanisms.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>(Strophe.Connection) connection</td><td class=CDLDescription>Target Connection.</td></tr></table><h4 class=CHeading>Returns</h4><p>(Boolean) If mechanism was able to run.</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.SASLMechanism.Constants"></a>Constants</h3></div></div>

<div class="CConstant"><div class=CTopic><h3 class=CTitle><a name="Strophe.SASLMechanism.SASL_mechanisms"></a>SASL mechanisms</h3><div class=CBody><p>Available authentication mechanisms</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry><a name="Strophe.SASLMechanism.Strophe.SASLAnonymous"></a>Strophe.SASLAnonymous</td><td class=CDLDescription>SASL Anonymous authentication.</td></tr><tr><td class=CDLEntry><a name="Strophe.SASLMechanism.Strophe.SASLPlain"></a>Strophe.SASLPlain</td><td class=CDLDescription>SASL Plain authentication.</td></tr><tr><td class=CDLEntry><a name="Strophe.SASLMechanism.Strophe.SASLMD5"></a>Strophe.SASLMD5</td><td class=CDLDescription>SASL Digest-MD5 authentication</td></tr><tr><td class=CDLEntry><a name="Strophe.SASLMechanism.Strophe.SASLSHA1"></a>Strophe.SASLSHA1</td><td class=CDLDescription>SASL SCRAM-SHA1 authentication</td></tr></table></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="Strophe.Bosh"></a>Strophe.Bosh</h2><div class=CBody><p><u>Private</u> helper class that handles BOSH Connections</p><p>The Strophe.Bosh class is used internally by Strophe.Connection to encapsulate BOSH sessions.&nbsp; It is not meant to be used from user&rsquo;s code.</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.Bosh.Files" >Files</a></td><td class=SDescription></td></tr><tr class="SFile SIndent1 SMarked"><td class=SEntry><a href="#bosh.js" >bosh.js</a></td><td class=SDescription>A JavaScript library to enable BOSH in Strophejs.</td></tr><tr class="SGroup"><td class=SEntry><a href="#Strophe.Bosh.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent1 SMarked"><td class=SEntry><a href="#Strophe.Bosh.strip" id=link125 onMouseOver="ShowTip(event, 'tt60', 'link125')" onMouseOut="HideTip('tt60')">strip</a></td><td class=SDescription>BOSH-Connections will have all stanzas wrapped in a &lt;body&gt; tag when passed to <a href="#Strophe.Connection.xmlInput" class=LFunction id=link126 onMouseOver="ShowTip(event, 'tt61', 'link126')" onMouseOut="HideTip('tt61')">Strophe.Connection.xmlInput</a> or <a href="#Strophe.Connection.xmlOutput" class=LFunction id=link127 onMouseOver="ShowTip(event, 'tt62', 'link127')" onMouseOut="HideTip('tt62')">Strophe.Connection.xmlOutput</a>. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.Bosh.Files"></a>Files</h3></div></div>

<div class="CFile"><div class=CTopic><h3 class=CTitle><a name="bosh.js"></a>bosh.js</h3><div class=CBody><p>A JavaScript library to enable BOSH in Strophejs.</p><p>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></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.Bosh.Variables"></a>Variables</h3></div></div>

<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="Strophe.Bosh.strip"></a>strip</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">strip: null</td></tr></table></blockquote><p>BOSH-Connections will have all stanzas wrapped in a &lt;body&gt; tag when passed to <a href="#Strophe.Connection.xmlInput" class=LFunction id=link128 onMouseOver="ShowTip(event, 'tt61', 'link128')" onMouseOut="HideTip('tt61')">Strophe.Connection.xmlInput</a> or <a href="#Strophe.Connection.xmlOutput" class=LFunction id=link129 onMouseOver="ShowTip(event, 'tt62', 'link129')" onMouseOut="HideTip('tt62')">Strophe.Connection.xmlOutput</a>.&nbsp; To strip this tag, User code can set <a href="#Strophe.Bosh.strip" class=LVariable id=link130 onMouseOver="ShowTip(event, 'tt60', 'link130')" onMouseOut="HideTip('tt60')">Strophe.Bosh.strip</a> to &ldquo;body&rdquo;:</p><blockquote><pre>Strophe.Bosh.prototype.strip = &quot;body&quot;;</pre></blockquote><p>This will enable stripping of the body tag in both <a href="#Strophe.Connection.xmlInput" class=LFunction id=link131 onMouseOver="ShowTip(event, 'tt61', 'link131')" onMouseOut="HideTip('tt61')">Strophe.Connection.xmlInput</a> and <a href="#Strophe.Connection.xmlOutput" class=LFunction id=link132 onMouseOver="ShowTip(event, 'tt62', 'link132')" onMouseOut="HideTip('tt62')">Strophe.Connection.xmlOutput</a>.</p></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="Strophe.WebSocket"></a>Strophe.<wbr>WebSocket</h2><div class=CBody><p><u>Private</u> helper class that handles WebSocket Connections</p><p>The Strophe.WebSocket class is used internally by Strophe.Connection to encapsulate WebSocket sessions.&nbsp; It is not meant to be used from user&rsquo;s code.</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.WebSocket.Files" >Files</a></td><td class=SDescription></td></tr><tr class="SFile SIndent1 SMarked"><td class=SEntry><a href="#websocket.js" >websocket.js</a></td><td class=SDescription>A JavaScript library to enable XMPP over Websocket in Strophejs.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Strophe.WebSocket.Files"></a>Files</h3></div></div>

<div class="CFile"><div class=CTopic><h3 class=CTitle><a name="websocket.js"></a>websocket.js</h3><div class=CBody><p>A JavaScript library to enable XMPP over Websocket in Strophejs.</p><p>This file implements XMPP over WebSockets for Strophejs.&nbsp; If a Connection is established with a Websocket url (ws://...)&nbsp; Strophe will use WebSockets.&nbsp; For more information on XMPP-over WebSocket see this RFC draft: <a href="http://tools.ietf.org/html/draft-ietf-xmpp-websocket-00" class=LURL target=_top>http://tools.ietf.org<wbr>/html<wbr>/draft-ietf-xmpp-websocket-00</a></p><p>WebSocket support implemented by Andreas Guth (<a href="#" onClick="location.href='mai' + 'lto:' + 'andrea' + 's.guth' + '@' + 'rwth-aa' + 'chen.de'; return false;" class=LEMail>andrea<span style="display: none">.nosp@m.</span>s.guth<span>@</span>rwth-aa<span style="display: none">.nosp@m.</span>chen.de</a>)</p></div></div></div>

</div><!--Content-->


<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MEntry><div class=MFile id=MSelected>strophe.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/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/General.html">Everything</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 class=MEntry><div class=MIndex><a href="../index/Variables.html">Variables</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../search");
--></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><option value="Variables">Variables</option></select></div></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<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  prettyprint "nowrap>function $build(</td><td class="PParameter  prettyprint " nowrap>name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>attrs</td><td class="PAfterParameters  prettyprint "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  prettyprint "nowrap>function $msg(</td><td class="PParameter  prettyprint " nowrap>attrs</td><td class="PAfterParameters  prettyprint "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  prettyprint "nowrap>function $iq(</td><td class="PParameter  prettyprint " nowrap>attrs</td><td class="PAfterParameters  prettyprint "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  prettyprint "nowrap>function $pres(</td><td class="PParameter  prettyprint " nowrap>attrs</td><td class="PAfterParameters  prettyprint "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  prettyprint "nowrap>addNamespace: function (</td><td class="PParameter  prettyprint " nowrap>name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>value</td><td class="PAfterParameters  prettyprint "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  prettyprint "nowrap>forEachChild: function (</td><td class="PParameter  prettyprint " nowrap>elem,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>elemName,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>func</td><td class="PAfterParameters  prettyprint "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  prettyprint "nowrap>isTagEqual: function (</td><td class="PParameter  prettyprint " nowrap>el,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>name</td><td class="PAfterParameters  prettyprint "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 class="prettyprint">xmlGenerator: function ()</td></tr></table></blockquote>Get the DOM document to generate elements.</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  prettyprint "nowrap>xmlElement: function (</td><td class="PParameter  prettyprint " nowrap>name</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Create an XML DOM element.</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  prettyprint "nowrap>xmlescape: function(</td><td class="PParameter  prettyprint " nowrap>text</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Excapes invalid xml characters.</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  prettyprint "nowrap>xmlTextNode: function (</td><td class="PParameter  prettyprint " nowrap>text</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Creates an XML DOM text node.</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  prettyprint "nowrap>xmlHtmlNode: function (</td><td class="PParameter  prettyprint " nowrap>html</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Creates an XML DOM html node.</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  prettyprint "nowrap>getText: function (</td><td class="PParameter  prettyprint " nowrap>elem</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Get the concatenation of all text children of an element.</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  prettyprint "nowrap>copyElement: function (</td><td class="PParameter  prettyprint " nowrap>elem</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Copy an XML DOM element.</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  prettyprint "nowrap>createHtml: function (</td><td class="PParameter  prettyprint " nowrap>elem</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Copy an HTML DOM element into an XML DOM.</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  prettyprint "nowrap>escapeNode: function (</td><td class="PParameter  prettyprint " nowrap>node</td><td class="PAfterParameters  prettyprint "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="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  prettyprint "nowrap>unescapeNode: function (</td><td class="PParameter  prettyprint " nowrap>node</td><td class="PAfterParameters  prettyprint "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="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  prettyprint "nowrap>getNodeFromJid: function (</td><td class="PParameter  prettyprint " nowrap>jid</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Get the node portion of 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  prettyprint "nowrap>getDomainFromJid: function (</td><td class="PParameter  prettyprint " nowrap>jid</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Get the domain portion of a JID String.</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  prettyprint "nowrap>getResourceFromJid: function (</td><td class="PParameter  prettyprint " nowrap>jid</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Get the resource portion of a JID String.</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  prettyprint "nowrap>getBareJidFromJid: function (</td><td class="PParameter  prettyprint " nowrap>jid</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Get the bare JID from a JID String.</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  prettyprint "nowrap>debug: function(</td><td class="PParameter  prettyprint " nowrap>msg</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Log a message at the Strophe.LogLevel.DEBUG 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  prettyprint "nowrap>info: function (</td><td class="PParameter  prettyprint " nowrap>msg</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Log a message at the Strophe.LogLevel.INFO 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  prettyprint "nowrap>warn: function (</td><td class="PParameter  prettyprint " nowrap>msg</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Log a message at the Strophe.LogLevel.WARN 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  prettyprint "nowrap>error: function (</td><td class="PParameter  prettyprint " nowrap>msg</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Log a message at the Strophe.LogLevel.ERROR level.</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  prettyprint "nowrap>fatal: function (</td><td class="PParameter  prettyprint " nowrap>msg</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Log a message at the Strophe.LogLevel.FATAL level.</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  prettyprint "nowrap>serialize: function (</td><td class="PParameter  prettyprint " nowrap>elem</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Render a DOM element and all descendants to a String.</div></div><div class=CToolTip id="tt28"><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  prettyprint "nowrap>addConnectionPlugin: function (</td><td class="PParameter  prettyprint " nowrap>name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ptype</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Extends the Strophe.Connection object with the given plugin.</div></div><div class=CToolTip id="tt29"><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  prettyprint "nowrap>Strophe.Builder = function (</td><td class="PParameter  prettyprint " nowrap>name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>attrs</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Create a Strophe.Builder object.</div></div><div class=CToolTip id="tt30"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">tree: function ()</td></tr></table></blockquote>Return the DOM tree.</div></div><div class=CToolTip id="tt31"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">toString: function ()</td></tr></table></blockquote>Serialize the DOM tree to a String.</div></div><div class=CToolTip id="tt32"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">up: function ()</td></tr></table></blockquote>Make the current parent element 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  prettyprint "nowrap>attrs: function (</td><td class="PParameter  prettyprint " nowrap>moreattrs</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Add or modify attributes of the 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  prettyprint "nowrap>c: function (</td><td class="PParameter  prettyprint " nowrap>name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>attrs,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>text</td><td class="PAfterParameters  prettyprint "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="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  prettyprint "nowrap>cnode: function (</td><td class="PParameter  prettyprint " nowrap>elem</td><td class="PAfterParameters  prettyprint "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="tt36"><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  prettyprint "nowrap>t: function (</td><td class="PParameter  prettyprint " nowrap>text</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Add a child text element.</div></div><div class=CToolTip id="tt37"><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  prettyprint "nowrap>h: function (</td><td class="PParameter  prettyprint " nowrap>html</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Replace current element contents with the HTML passed in.</div></div><div class=CToolTip id="tt38"><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  prettyprint "nowrap>Strophe.Connection = function (</td><td class="PParameter  prettyprint " nowrap>service,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>options</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Create and initialize a Strophe.Connection object.</div></div><div class=CToolTip id="tt39"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">reset: function ()</td></tr></table></blockquote>Reset the connection.</div></div><div class=CToolTip id="tt40"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">pause: function ()</td></tr></table></blockquote>Pause the request manager.</div></div><div class=CToolTip id="tt41"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">resume: function ()</td></tr></table></blockquote>Resume the request manager.</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  prettyprint "nowrap>getUniqueId: function (</td><td class="PParameter  prettyprint " nowrap>suffix</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Generate a unique ID for use in iq/ elements.</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  prettyprint "nowrap>connect: function (</td><td class="PParameter  prettyprint " nowrap>jid,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>pass,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>callback,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>wait,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>hold,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>route</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Starts the connection process.</div></div><div class=CToolTip id="tt44"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.authzid</td></tr></table></blockquote>Authorization identity.</div></div><div class=CToolTip id="tt45"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.authcid</td></tr></table></blockquote>Authentication identity (User name).</div></div><div class=CToolTip id="tt46"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.pass</td></tr></table></blockquote>Authentication identity (User password).</div></div><div class=CToolTip id="tt47"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.servtype</td></tr></table></blockquote>Digest MD5 compatibility.</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  prettyprint "nowrap>attach: function (</td><td class="PParameter  prettyprint " nowrap>jid,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>sid,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>rid,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>callback,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>wait,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>hold,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>wind</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Attach to an already created and authenticated BOSH session.</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  prettyprint "nowrap>send: function (</td><td class="PParameter  prettyprint " nowrap>elem</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Send a stanza.</div></div><div class=CToolTip id="tt50"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">flush: function ()</td></tr></table></blockquote>Immediately send any pending outgoing data.</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  prettyprint "nowrap>sendIQ: function(</td><td class="PParameter  prettyprint " nowrap>elem,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>callback,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>errback,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>timeout</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Helper function to send IQ stanzas.</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  prettyprint "nowrap>addTimedHandler: function (</td><td class="PParameter  prettyprint " nowrap>period,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>handler</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Add a timed handler to the 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  prettyprint "nowrap>deleteTimedHandler: function (</td><td class="PParameter  prettyprint " nowrap>handRef</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Delete a timed handler for a connection.</div></div><div class=CToolTip id="tt54"><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  prettyprint "nowrap>addHandler: function (</td><td class="PParameter  prettyprint " nowrap>handler,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>ns,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>name,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>type,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>id,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>from,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>options</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Add a stanza handler for the connection.</div></div><div class=CToolTip id="tt55"><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  prettyprint "nowrap>deleteHandler: function (</td><td class="PParameter  prettyprint " nowrap>handRef</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Delete a stanza handler for a connection.</div></div><div class=CToolTip id="tt56"><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  prettyprint "nowrap>disconnect: function (</td><td class="PParameter  prettyprint " nowrap>reason</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Start the graceful disconnection process.</div></div><div class=CToolTip id="tt57"><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  prettyprint "nowrap>authenticate: function (</td><td class="PParameter  prettyprint " nowrap>matched</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Set up authentication</div></div><div class=CToolTip id="tt58"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">this.priority</td></tr></table></blockquote>Determines which SASLMechanism is chosen for authentication (Higher is better). </div></div><div class=CToolTip id="tt59"><div class=CClass>encapsulates SASL authentication mechanisms.</div></div><div class=CToolTip id="tt60"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">strip: null</td></tr></table></blockquote>BOSH-Connections will have all stanzas wrapped in a body tag when passed to Strophe.Connection.xmlInput or Strophe.Connection.xmlOutput. </div></div><div class=CToolTip id="tt61"><div class=CFunction>User overrideable function that receives XML data coming into the connection.</div></div><div class=CToolTip id="tt62"><div class=CFunction>User overrideable function that receives XML data sent to the connection.</div></div><div class=CToolTip id="tt63"><div class=CFunction>Checks if mechanism able to run. </div></div><div class=CToolTip id="tt64"><div class=CConstant>Available authentication mechanisms</div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>