I just need your help about my code. My problem is how can I access smarty variable within jquery or javascript file? Becuase my smarty variable is a URL request from my controller. And I need to use that variable for creating validation. Here's my code.

```
{$get.search_by} {**works without error**}

{literal}
    <script type="text/javascript">

        $(document).ready(function(){

            var dispatch = "{$get.search_by}"; //can't access

            var new_class = "it3 ir3 il3 jt10 jr05 jl05 kt03 kr04 kl04";
            var old_class = "it3 ib3 il3 jt05 jb05 jl10 kt04 kb04 kl03";

            var toggleState = true;

            //could not access
            if(dispatch == companies.catalog){
                alert("catalog");
            }else{
                alert("product search");
            }

            console.log(dispatch);

```