For example, having:
So what
They are there to fool browsers into thinking that it is a new file.
This is a trick to avoid browser-cached copy when you update the JS file.
IMHO, a JavaScript source like this will request "dynamic" content from server, thus the server will not try to use cached version of JavaScript file. Whether or not the parameter really does matter is up to the server.
Its a url param like any other parameter passed in a url. Sometimes JS scripts are created on the fly using server side technologies other times it is simply a version number to help with browser caching issues.
It means a variable is being passed to the script via GET
, though standard JavaScript files don't support any means of collecting the variable.
You could, however, write a server script in PHP or ASP.NET that sets the content type as application/x-javascript
.
Like this in php:
// file: external.php
<?php header("content-type: application/x-javascript"); ?>
// regular javascript here that uses $_GET['variable'];
Then you could put this in your HTML script tag:
<script type="text/javascript" src="external.php?variable=14"></script>
The javascript script is probably generated by a server side script (PHP, CGI, etc.) , which takes 14 as a parameter.
This is a query parameter as the browser will make an http get request to the somedomain.com for the javascript source.
If you load the page with a header browser like fiddler, you will see exactly what's going on.