Changeset 4513 for trunk/template-common/scripts.js
- Timestamp:
- Dec 18, 2009, 10:12:41 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/template-common/scripts.js
r3282 r4513 112 112 this.transport.onreadystatechange = this.onStateChange.pwgBind(this); 113 113 114 var url = this.urlRoot; 115 url += "ws.php?format=json&method="+method; 114 var url = this.urlRoot+"ws.php?format=json"; 115 116 var body = "method="+method; 116 117 if (parameters) 117 118 { … … 121 122 { 122 123 for (var i=0; i<parameters[property].length; i++) 123 url+= "&"+property+"[]="+encodeURIComponent(parameters[property][i]);124 body += "&"+property+"[]="+encodeURIComponent(parameters[property][i]); 124 125 } 125 126 else 126 url+= "&"+property+"="+encodeURIComponent(parameters[property]);127 body += "&"+property+"="+encodeURIComponent(parameters[property]); 127 128 } 128 129 } 129 this.transport.open(this.options.method, url, this.options.async); 130 this.transport.send(null); 130 131 if (this.options.method == "POST" ) 132 { 133 this.transport.open(this.options.method, url, this.options.async); 134 this.transport.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 135 this.transport.send(body); 136 } 137 else 138 { 139 url += "&"+body; 140 this.transport.open(this.options.method, url, this.options.async); 141 this.transport.send(null); 142 } 131 143 }, 132 144
Note: See TracChangeset
for help on using the changeset viewer.