-2
<script language="Javascript" src="js/configurationJS.js?cid=${buildnumber}" type="text/javascript"></script>

I Have a Script tag like above and i don't know the purpose of ? before cid and also what cid=${buildnumber} indicates. Thanks in advance.

  • 4
    The `?` is to pass get parameters (by the url). In this case you are passing `cid` parameter with a buildnumber value. buildnumber must be some var you have. – jeprubio Mar 03 '20 at 06:24
  • are we passing the parameter to a function? – s.surya Prakash Mar 03 '20 at 07:08
  • Not in that piece of code. The parameters are set in the url and then can be retrieved and used as you like. See https://stackoverflow.com/questions/979975/how-to-get-the-value-from-the-get-parameters – Buddy Christ Mar 03 '20 at 07:39

2 Answers2

0

The parameters can be get or post.

The get ones are shown in the url in this format:

url?param1=value1&param2=value2&param3=value3

In your configurationJS.js url you are passing a buildnumber value to the cid parameter.

Buddy Christ
  • 1,364
  • 8
  • 22
0

For get request type and for passing any data (eg. id) from one page to another page, we append query params in URL and to differentiate the URL path and query params we use "?" symbols.

"?" act as separator, it indicates end of URL base path and start of query params.

Riti verma
  • 21
  • 3