65.9K
CodeProject is changing. Read more.
Home

Javascript Injection at it's Finest!, without even using Eval()!

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.90/5 (6 votes)

May 15, 2011

CPOL
viewsIcon

21060

JS Injection


String.prototype.code = function(){ return (new Function('with(this) { return ' + this + '}' )).call({}); };
var s = 'alert("hello!");'
s.code();