Click here to Skip to main content
Click here to Skip to main content

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

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

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

VectorX
Software Developer (Senior) Codevendor
United States United States
Member
Please visit my personal website http://www.codevendor.com for my latest codes and updates.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralVery interesting solution! PinmemberDrABELL15 May '11 - 16:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 15 May 2011
Article Copyright 2011 by VectorX
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid