check if URL contains some text (javascript)

darths

New Member
how can i use javascript/jQuery to check if a URL contains a specific link/text.for example :
A user browse to my site and his URL is : "http//www.mywebsite.com/userprofile/abc&from=home"

I have set a variable and its value is "http//www.mywebsite.com/userprofile/abc" , i want to know how to detect if "http//www.mywebsite.com/userprofile/abc" exist in the URL("http//www.mywebsite.com/userprofile/abc&from=home") then execute a function.Thanks!
 
Top