I want to get URL parameters and extract last param from:
http://localhost/projecct/Menus/page/8
This gives me 8:
var url = window.location.toString();
var pid = url.substring(url.lastIndexOf('/') + 1); // this gives 8
var currentMenu=('menu'+pid); //this gives menu8
alert($('.'+currentMenu).html()); //but this give me null
//the above line is where I stucked
I want to make CSS property display:block for the parent all uls selected with:
$('.'+currentMenu).parents("ul").css({'display':'block'});
HTML:
<ul>
<li class='menu1'>
<a href='#'>Menu1</a>
<ul>
<li class='menu11'>
<a href='#'>Menu11</a>
<ul>....</ul>
</li>
</ul>
</li>
<li class='menu2'>
<a href='#'>Menu2</a>
<ul>
<li class='menu21'>
<a href='#'>Menu21</a>
<ul>....</ul>
</li>
<li class='menu22'>
<a href='#'>Menu22</a>
<ul>....</ul>
</li>
</ul>
</li>
<li class='menu3'>
..........
</li>
</ul>
$('.'+ currentMenu).lengthand tell what you get.class="menu8"on the page.