I have a button that has its location generated dynamically via jquery:

```
<a id="final_location" 
   href="/pre_config/step4" 
   class="proceed-btn right">Proceed To Next Step &gt;&gt;&gt;</a>

```

```
    $('#final_location').click(function() {
        location.href = this.href + '/' + escape($('#type_of_station').html()) + 
            '/' + escape($('.number_changer').attr("id").slice(-1));
        return false;
    });

```

this works great but the problem comes into play when the html in type\_of\_station is two words... I get this url:

```
pre_config/step4/Pizza Delivery/2

```

Is there a way to make the url only give me the first word like this:

```
pre_config/step4/Pizza/2

```

maybe this can be changed to only return the first word?