var obj = 'A';
As with the PHP function ord(), charCodeAt() can only convert one symbol at a time. Meaning that if an entire string is provided, only the first symbol, or the symbol specified within the brackets according to position will be converted. However, there is a way around this by running the whole string through a loop:
var convertedObj = '';
for(i = 0; i < obj.length; i++)
var asciiChar = obj.charCodeAt(i);
convertedObj += '' + asciiChar + ';';
Using this method each character will be translated individually and added to the variable convertedObj.