search for: escapehash

Displaying 1 result from an estimated 1 matches for "escapehash".

2005 Dec 02
0
Prototype Hash#map & #each
...say hello to me"]; a.map(escape).each(function(x) { document.write(x + "<br />"); //nice and clean syntax }) // Hash (not so elegant) var h = $H({name: "john doe", email: "john-Ch9RrZxMC0c@public.gmane.org", msg: "say hello to me"}); function escapeHash(x) { x[1] = escape(x[1]); return x; } h.map(escapeHash).each(function(x) { document.write(x[0] + " => " + x[1] + "<br />"); }); // This way would be nice h.map(function(element, index) { return escape(element) }).each(function(element, index)) { documen...