if (pathname == "/" || pathname == "/default.asp")
in js using jquery library.
I want this to catch "Default.asp" as well as "DeFaULT.asp" and "default.asp"
halp.
if (pathname == "/" || pathname == "/default.asp")
in js using jquery library.
I want this to catch "Default.asp" as well as "DeFaULT.asp" and "default.asp"
halp.
Share Improve this question asked Jun 8, 2010 at 1:32 NoemiNoemi 131 silver badge3 bronze badges2 Answers
Reset to default 2Use the string.toLowerCase()
method, this is base javascript, no jQuery needed:
pathname = pathname.toLowerCase();
if (pathname == "/" || pathname == "/default.asp") {
//case in-sensitive math!
}
I believe this might work:
if (pathname == "/" || pathname.toLowerCase() == "/default.asp")