I'm using jquery, and I need to check the URL to see if the user is looking at tagged/categorized content.
I need to check the URL to do so. Before, I was doing something like this to check to see what page the user was on...
var loc = window.location;
var pageOne = 'http://design.optimus.com/projects';
if(loc == pageOne) {
//do stuff
}
But these URLs never changed, so it was easy for me to check if they were on a single URL or not.
However, the new urls are going to have different endings depending on the tag the user searches for. For example,
http://optidesign.squarespace.com/projects/tag/design
http://optidesign.squarespace.com/projects/tag/production
http://optidesign.squarespace.com/projects/tag/animation
So I want to use sort of the same method as the first part, but I just want to check for the beginning of the URL:
http://optidesign.squarespace.com/projects/tag/
How do i go about doing this?