3 ms·
I learned another interesting way to create strings in JavaScript without using a quote character: var s = /string you want/.source;
by brown9-2 14y ago
I learned another interesting way to create strings in JavaScript without using a quote character:
var s = /string you want/.source;
- tvdw 14y agoThis works well if for some reason they block fromCharCode: eval(unescape(/your escaped code goes here/.source)) Use Javascript's escape() to generate the code
- dividuum 14y agoAnother way is to use the technique described at http://patriciopalladino.com/blog/2012/08/09/non-alphanumeric-javascript.html http://patriciopalladino.com/blog/2012/08/09/non-alphanumeri... It transforms javascript into a sequence of ()[]{}!+
- brown9-2 14y agoWow, it seems like there is no limit to what you can accomplish by abusing type coercion.
- nulluk 14y agounfortunately i ended up with String.fromCharCode, would of made the final code a lot more readable! https://gist.github.com/3527252 https://gist.github.com/3527252
- reader_1000 14y agoI used DOM api to avoid quote character: document.links[0].href
- DropkickM16 14y agoI figured out how to insert strings with quotes on level 6 - if you use a param list like username[]={string"with'quotes'"}, it bypasses the safety check but still gets coerced to a string by the ORM. Unfortunately, I wasn't clever enough to actually do anything with that...