I want to expose URLs for user profiles in my web-app in the format:
example.com/user/<userId>
This should load the file user.html
which contains JavaScript (ajax) code to load content based on the requested userId
.
What options do I have to get userId
parameter from the URL into my user.html
file?
The way I can think of is to use a server-side language like PHP to embed the userId
inside the HTML/JavaScript. Would like to see if there are other better options.