0

Here's my question: How to use a question mark in url ? For a school project I need to use "?version=1", "?version=2" and "?version=3" in my url for 3 different versions of a website but after some researches, I found that the ? is used to pass a query string and use it in server-side but I haven't found more informations or doc. My problem is that we don't have server for the project and I would know if I can still the question mark and if it's possible to use it in Javascript in order to display specific elements on the page according to the version of the website I'm using. Thanks !

Saantuu
  • 21
  • 7
  • 2
    Does this answer your question? [How can I get query string values in JavaScript?](https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript) – ARC Dec 13 '21 at 17:46
  • 1
    Your question is asked in a bad way. You had to ask, how to retrieve the query string in javascript and read the values of parameters. Your question seems how to use tha question mark value in the value of a parameter instead, in that case you had to use entities. – Umbert Dec 13 '21 at 17:54

1 Answers1

1

You can still use the query string (?version=1) without having access to the server. Just capture the value using the method Austin linked and go from there.

user2868900
  • 671
  • 1
  • 8
  • 27