Link to home
Create AccountLog in
Avatar of rkoechel
rkoechelFlag for United States of America

asked on

Having trouble escaping variables in javascript

I have the below javascript snippet: #url.typ# and #url.dept# are coldfusion variable on my site.  Some of the variables have an apostrophe in them, ex. men's   Can I escape them inside this snippet somehow?
<script type='text/javascript'>
product.Catalog.init({
    filters: {
        category: ['#url.typ#'],
        department: ['#url.dept#']
    },
    maxFacetOptions: 10
});
</script>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Justin Mathews
Justin Mathews

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account