- #44939: Fix Unicode autocomplete in IE

4.7.x
Steven Wittens 2006-01-22 17:37:41 +00:00
parent 14ae238973
commit a1e4655bbc
3 changed files with 8 additions and 6 deletions

View File

@ -222,7 +222,6 @@ jsAC.prototype.found = function (matches) {
*/
function ACDB(uri) {
this.uri = uri;
this.max = 15;
this.delay = 300;
this.cache = {};
}
@ -241,7 +240,7 @@ ACDB.prototype.search = function(searchString) {
var db = this;
this.timer = setTimeout(function() {
addClass(db.owner.input, 'throbbing');
HTTPGet(db.uri +'/'+ searchString +'/'+ db.max, db.receive, db);
HTTPGet(db.uri +'/'+ encodeURIComponent(searchString), db.receive, db);
}, this.delay);
}

View File

@ -38,7 +38,9 @@ if (typeof XMLHttpRequest == 'undefined') {
}
/**
* Creates an HTTP GET request and sends the response to the callback function
* Creates an HTTP GET request and sends the response to the callback function.
*
* Note that dynamic arguments in the URI should be escaped with encodeURIComponent().
*/
function HTTPGet(uri, callbackFunction, callbackParameter) {
var xmlHttp = new XMLHttpRequest();
@ -81,8 +83,9 @@ function HTTPPost(uri, callbackFunction, callbackParameter, object) {
var toSend = '';
if (typeof object == 'object') {
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
for (var i in object)
toSend += (toSend ? '&' : '') + i + '=' + escape(object[i]);
for (var i in object) {
toSend += (toSend ? '&' : '') + i + '=' + encodeURIComponent(object[i]);
}
}
else {
toSend = object;

View File

@ -39,7 +39,7 @@ jsUpload.prototype.onsubmit = function () {
var hide = $(this.hide);
// Insert progressbar and stretch to take the same space.
this.progress = new progressBar('uploadprogress');
this.progress.setProgress(-1, 'Uploading file...');
this.progress.setProgress(-1, 'Uploading file');
this.progress.element.style.width = '28em';
this.progress.element.style.height = hide.offsetHeight +'px';
hide.parentNode.insertBefore(this.progress.element, hide);