Skip to content

Commit

Permalink
in facebooker.js, encode uri components globally
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Jordan authored and mmangino committed Jul 25, 2008
1 parent 0a4b56b commit a9ccd56
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions javascripts/facebooker.js
Expand Up @@ -34,7 +34,7 @@ var Element = {
};

function encodeURIComponent(str) {
return str.replace('=','%3D').replace('&','%26');
return str.replace(/=/g,'%3D').replace(/&/g,'%26');
};

var Form = {};
Expand Down Expand Up @@ -75,8 +75,8 @@ Ajax.Updater = function (container,url,options) {
pairs=options['parameters'].split('&');
for (var i=0; i<pairs.length; i++) {
kv=pairs[i].split('=');
key=kv[0].replace('%3D','=').replace('%26','&');
val=kv[1].replace('%3D','=').replace('%26','&');
key=kv[0].replace(/%3D/g,'=').replace(/%26/g,'&');
val=kv[1].replace(/%3D/g,'=').replace(/%26/g,'&');
parameters[key]=val;
}
this.ajax.post(url,parameters);
Expand Down

0 comments on commit a9ccd56

Please sign in to comment.