Huh... Use The Source, Luke

I to pogodi odakle:
http://devprotalk.com/clientscript/vbulletin_global.js
Kôd:
/**
* A sort of emulation of PHP's urlencode - not 100% the same, but accomplishes the same thing
*
* @param string String to encode
*
* @return string
*/
vB_PHP_Emulator.prototype.urlencode = function(text)
{
text = text.toString();
// this escapes 128 - 255, as JS uses the unicode code points for them.
// This causes problems with submitting text via AJAX with the UTF-8 charset.
var matches = text.match(/[\x90-\xFF]/g);
if (matches)
{
for (var matchid = 0; matchid < matches.length; matchid++)
{
var char_code = matches[matchid].charCodeAt(0);
text = text.replace(matches[matchid], '%u00' + (char_code & 0xFF).toString(16).toUpperCase());
}
}
return escape(text).replace(/\+/g, "%2B");
}
Mada, i ovo što je Akubra predložio radi sličnu stvar...
E sad, caka je što problem stvaraju samo karakteri & i =, ostali prolaze (naročito kad su uključeni magic quotes

)
Kad razmislim, možda je ono moje rješenje efikasnije...
