![]() |
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"> |
You're not assigning the return value to anything.
Why are you passing multiple parameters when the function isn't coded to handle them? |
Unfortunately, the quick answer is because I don't understand the logic of JavaScript and I've been asked to "learn on the job" to help with a project at work.
Any chance you can help me write the code to make it work properly? |
Also, if it helps, this is being generated in a .JSPF file. I thought it would be easier to troubleshoot if the source from the browser was posted rather than the raw code from the JSPF file.
I have _trackEvent and custom variables set up throughout the site in different .JSP files (well, _trackEvent tags are in multiple .JSPs, only one custom variable) so I am trying to find a solution that will replace special characters whenever they come up in these tags on other pages too. If there is a different solution, I'm all ears. |
This isn't even legal code:
Code:
removeSplChars('Kitchen Tools', 'Textiles', 'Chef's Apron', '');If you want to embed a " or ' inside a string that is delimited by the same character, you must "escape" the character: Code:
removeSplChars('Kitchen Tools', 'Textiles', 'Chef\'s Apron', '');Code:
removeSplChars('Kitchen Tools', 'Textiles', "Chef's Apron", '');Code:
_gaq.push(['_setCustomVar',At the least, it should produce no errors. |
| All times are GMT +1. The time now is 01:57 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.