What would be the right syntax in jQuery
<p>I have a jquery function which on submit event is generating an url.If one the parameter is not defined, adding to url should be skipped            </p>

<pre><code>        var category        =$("#prod_category").val();
        var group           =$("#prod_group")
        window.location.href = "/page/" +
            **//add to url if category is definned**
        encodeURI(category) + "/" +
            **//add to url if group is definned**       
        encodeURI(group) + "/" +
</code></pre>
