Link to home
Start Free TrialLog in
Avatar of ITsolutionWizard
ITsolutionWizardFlag for United States of America

asked on

jquery segment

with the following js codes,

using this url works: http://localhost:3835/Home/Index 

but this one does not works: http://localhost:3835/Home/Index?f=1.

it just return nothing. do you know how to fix it?

function GetSegmentPositionName(position) {
    var pathArray = window.location.pathname.split('/');
    var segment = pathArray[position];
    return segment;
}

Open in new window

Avatar of leakim971
leakim971
Flag of Guadeloupe image

both return nothing for position equal to 0
Avatar of ITsolutionWizard

ASKER

using this url works: http://localhost:3835/Home/Index  - it works on this one
how do you use it?
so we're on the same path
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial