Possible Duplicate:
Get query string values in JavaScript
Say if,i’ve a URL like this update test
I want to check if URL has a parameter q.
Can i use $get() ,to do this.
If(urlparamerter == q)
{
do some thing
}
Is there any jquery build in function which does this?
Thanks in advance!
No, there is no jQuery Built in function to do this. You can use the following function, found from this SO answer
To get the
qparameter just call it likeUPDATE
If you want to use this function by passing
urlinstead of usingcurrent page's urlmodify the function like follwoingand then you can call it like
Working Fiddle