[Xmpp4js-commit] SF.net SVN: xmpp4js: [721] trunk/src/main/javascript/transport/Script.js
Status: Beta
Brought to you by:
h-iverson
From: <h-i...@us...> - 2008-07-05 05:51:07
|
Revision: 721 http://xmpp4js.svn.sourceforge.net/xmpp4js/?rev=721&view=rev Author: h-iverson Date: 2008-07-04 22:51:13 -0700 (Fri, 04 Jul 2008) Log Message: ----------- script syntax is now working Modified Paths: -------------- trunk/src/main/javascript/transport/Script.js Modified: trunk/src/main/javascript/transport/Script.js =================================================================== --- trunk/src/main/javascript/transport/Script.js 2008-07-05 05:06:47 UTC (rev 720) +++ trunk/src/main/javascript/transport/Script.js 2008-07-05 05:51:13 UTC (rev 721) @@ -65,15 +65,21 @@ this.prepareWrite( packetNode ); + var xml = packetNode.toString(); + // TODO check for max length constraints in browsers - var requestUrl = this.endpoint+"?body="+xml; + // HACK substr(5) takes out body=; there should be a method to + // only encode the right-hand side of the params. + var requestUrl = this.endpoint+"?"+Ext.urlEncode({body: xml}).substr(5); + var scriptElem = document.createElement( "script" ); scriptElem.setAttribute( "type", "text/javascript" ); scriptElem.setAttribute( "src", requestUrl ); + scriptElem.setAttribute( "id", "xmpp4js"+"."+this.sid+"."+packetNode.getAttribute("rid") ); // TODO handle multiple connections... window._BOSH_ = function(xml) { - this.handleResponse(); + this.onWriteResponse(xml); }.bind(this); document.body.appendChild( scriptElem ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |