Solved

how do you check a url and make it case insensitve?

Posted on 2014-11-24
2
79 Views
Last Modified: 2014-11-24
hHi,

I have a function that checks a url and see if it contains specific characters.  My problem is that sometimes the url is in uppercase and some times  its in lower case.

Is it possible to have the function case insensitive?

This is what I have so far

Thanks

<script type="text/javascript">
        $(document).ready(function () {
  var url = window.location.href;
if (url.indexOf("id_")>-1 || url.indexOf("con_id_") > -1)
{
  var num = url.replace("con_id","").replace("id_","");
  alert("Found it");
  alert(num);
}
		});
    </script>

Open in new window

0
Comment
Question by:smfmetro10
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40463561
Use

var url = window.location.href.toLowerCase();
0
 

Author Closing Comment

by:smfmetro10
ID: 40463572
Thanks!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now