Welcome To Snipplr
Everyone's Recent JavaScript Snippets Tagged replace
- All /
 - JavaScript /
 - HTML /
 - PHP /
 - CSS /
 - Ruby /
 - Objective C
 
 « Prev 1 Next »
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 
        
        
            1169 
        
                    posted 14 years ago by ultranaut
            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 
        
        
            1322 
        
                    posted 14 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 
        
        
            1194 
        
                    posted 14 years ago by chlab
            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 
        
        
            1049 
        
                    posted 15 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 
        
        
            1250 
        
                    posted 15 years ago by boondoklife
            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 
        
        
            1392 
        
                    posted 16 years ago by duniyadnd
            
            JavaScript
        
            Regular Expressions simple strings search/replace escape method (with RE speed enhancment - precompilation)  
        
                    Usefull Regular Expressions enhancement. Simplifies standard string operations escaping special chars. And also saves precompiled REs for a speed increase.
        
        
        
            1 
        
        
            1276 
        
                    posted 19 years ago by cochambre
             « Prev 1 Next »