Welcome To Snipplr

Everyone's Recent JavaScript Snippets Tagged replace

« Prev 1 Next »
Converte tutti gli \n in <br>
0 58 posted 8 years ago by kajinka13
two awesome bits: using ''.replace() perform an action (other than replacing it) on some text, and a simple way to concatenate strings with a separator (retardedly simple but it always confuses me)
0 83 posted 8 years ago by ultranaut
0 56 posted 8 years ago by dato
image rollovers in jquery are usually super easy. However it sucks when working with absolute image paths - like a separate media server or CDN. Heres a quick snippet using substring and lastIndexOf to swap out the image src.
0 82 posted 8 years ago by inreflection7
It’s pretty straightforward, we loop the existing Views of the ScrollableView and copy each View, replacing the one to be change, to a new array. Then we tell the ScrollableView to use our new Views-array for it’s Views. I hope this helps someon...
0 87 posted 9 years ago by chlab
Normal replace() function only replaces first instance.
1 92 posted 9 years ago by rumremix
useful if you only want digits as input
0 40 posted 9 years ago by webstylr
These are essential javascript techniques every javascriptr must know. I will be adding more to this list, let me know what you'd like to see. Thanks!
0 59 posted 10 years ago by alvincrespo
This will need to be either embeded or included and you can then just use this as such myNewString = myStringVariable.nl2br();
0 65 posted 10 years ago by boondoklife
0 37 posted 10 years ago by aadsm
I'll never learn how to use this Markdown system. Anyway, here is the fixed code based on my comment on the following page: http://snipplr.com/view/14206/replace-spaces-with-underscores/ I'm sorry, I don't mean to hijack the code. :(
0 102 posted 11 years ago by duniyadnd
strip non alphanumerical characters while typing
1 69 posted 11 years ago by ginoplusio
Ability to change/add attributes to HTML using JQuery
1 54 posted 11 years ago by davebowker
This snippet adds a replaceAll method to the String prototype, so that you can call it later like this: "test string".replaceAll("s", "-"); // returns "te-t -tring"
1 74 posted 13 years ago by alvaroisorna
Why doesn't this work?
1 67 posted 13 years ago by gaunab
Usefull Regular Expressions enhancement. Simplifies standard string operations escaping special chars. And also saves precompiled REs for a speed increase.
1 94 posted 13 years ago by cochambre
« Prev 1 Next »