View Single Post
Old 10-05-2012, 06:58 PM   PM User | #1
surfbird0713
New Coder

 
Join Date: Jun 2012
Location: South Carolina
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
surfbird0713 is an unknown quantity at this point
Function is not removing special characters when called

I have a function to remove special characters but it's not working...not sure why. Can anyone help?
Code:
<script type="text/javascript">
			function removeSplChars(inStr) {
                    inStr = inStr.replace(/[^a-zA-Z0-9 ]/g, "");
                    return inStr;
                    }       
			var _gaq = _gaq || [];
			  _gaq.push(['_setAccount', 'UA-33021136-1']);
			              removeSplChars('Kitchen Tools', 'Textiles', 'Chef's Apron', '');
			  
			  
			     
                    _gaq.push(['_setCustomVar',
                                2, // This custom var is set to slot #2.
                                  'Kitchen Tools', // The top-level name for your online content categories.
                                  'Kitchen Tools|Textiles|Chef's Apron|', // Records value of breadcrumb name
                                  3 // Sets the scope to page-level.
                              ]); 
		            
			        
		        

			  _gaq.push(['_trackPageview']);
			
			  (function() {
			    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
			    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
			    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
			  })();
			
			</script>
surfbird0713 is offline   Reply With Quote