tags:

views:

33

answers:

0

I have this site that I am currently working on which is jQuery heavy and I have another challenge that I have encountered. The links on the top on the page

* Standard Class
* Bussiness Class
* Premium

These links are not working currently because i have not implemented them yet but i have a problem with the url. This is how I am currently generation the url

$(document).ready(function(){
  $('#final_location').click(function() {
 location.href = this.href +'/'+ encodeURIComponent($('#type_of_station').text().match(/^\S*/)[0])
     + '/'+ escape($('.number_changer').attr("id").slice(-1));

    return false;
});     
});

Which works great but i now need to append the value of the link selected. So i need to make the url to be:

http://posnation.com/pre_config/step3/Restaurant/1/business_class

instead of

http://posnation.com/pre_config/step3/Restaurant/1

Based on what is selected on the links

<div class="tabs">
  <ul>
        <li class="active"><span class="l"></span><a href="#">Standard Class</a><span class="r"></span></li>
    <li><span class="l"></span><a href="#">Bussiness Class</a><span class="r"></span></li>
    <li><span class="l"></span><a href="#">Premium</a><span class="r"></span></li>
 </ul>
   </div>

here is the link

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

Any ideas what i need to change the jQuery to, to make the final part of the url and also if there is an easy way to keep the link active after its clicked.....thanks alot