i have a url like this. http://localhost:8080/steer/trip/create/3. where in my page i want to get value \"3\" using the jquery . please help me
I am assuming you want to access the parameter value of your controller's action method via jQuery in the client.
In such case, I would rather emit the parameter value as a metadata in a view and query it with jQuery instead of parsing the url itself (you need to decide where to emit, though).
In ASP.NET MVC, if you have a Route that accepts the following pattern: {controller}{action}{param}, http:\myhost\mycontroller\myaction\3 and http:\myhost\mycontroller\myaction?param=3 are equivalent and parsing only one URL pattern will not be sufficient.
You may find examples in jQuery mdatadata plugin useful.
The following is one of the examples in the link above.
- ...
Please disregard this answer if my assumption is not correct.