I need to catch a callback in my razor view page from some social service API.
The callback request is implemented by HTTP GET method:
http://www.contactsimporter.com/home.cshtml
After callback is implemented I need to retrieve parameters(param1=value1¶m2=value2) from HTTP GET request.
For example:
http://www.contactsimporter.com/home.cshtml?param1=value1¶m2=value2
I need to retrieve this parameters param1=value1¶m2=value2 from callback URL.
Any idea or code example how can I get those parameters using JavaScript or jQuery code?
Thank you in advance.
Best Answer
Adapted from CSS-Tricks
window.location.pathname
Now you can treat the url like a normal string in Javascript and parse it accordingly.