javascript help
- Started
- Last post
- 7 Responses
- ********
I need help with JS;
I have function:
function switchTab(tabName) {
document.getElementById("home... = "none";
document.getElementById(tabName... = "current";
}then I have to check what is the URL
and I'm using this:
if(location.href.indexOf("flight... != -1 ) { switchTab('flight');
}Code above is repeated few times for different location, but oes anyone know how to use switch with location.href.indexOf("flightinf... instead of repeatinf if()...??
Thanks.
- neverblink0
bezul.. qbn doesn't realy support the posting of codes, do you have something online for us to check?
- ********0
sorry, I don't have;
What's the idea:
I have tabbed navigation based on list; when someone clicks one tab, the page is open, and JS should appy class for that list, and as the result - tab is marked with different color; problem is that page is powered by asp.net and I don't want to have many controls with navigation bar
- neverblink0
it'll be much simpler if you do this in your ASP code.
- ********0
Thanks for help :)
- neverblink0
// no it won't - it doesn't check which page it's currently on
- stupidresponse0
$(this).attr("href");