Link to home
Start Free TrialLog in
Avatar of Tom Knowlton
Tom KnowltonFlag for United States of America

asked on

window location ToUpper ??

$(document).ready(function ()
{
    var loc = window.location.href;

    if (loc.indexOf("CourseSearch.aspx") != -1)
    {
        alert("on coursesearch page");
    }
});

Right now this only works if the page name is "CourseSearch"

I need it to work as long as the letters are in the right sequence, regardless of case.

coursesearch
Coursesearch
CourseSearch
courseSearch
COUrsesearch
coursesearchH

all are valid names for the same page
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe 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
Avatar of Tom Knowlton

ASKER

Thanks!


I could not remember the name of the function...

$(document).ready(function ()
{
    var loc = window.location.href.toUpperCase();

    alert(loc);

    if (loc.indexOf("COURSESEARCH") != -1)
    {
        alert("on coursesearch page");
    }
});

Open in new window

It works.