如何在 JS 中转义对象的所有属性?
var literal = {
valid:'thisIsAValidValue',
toEscape:'ThîsStringNéédsToBéEscàped'
};
//Does not work
escape(literal)
//Does not work either, how to loop over attributes?
$.each(literal.attributes, function(){
this = escape(this);
});