Can anyone explain this code snippet to me?
<script type="text/javascript">
function querySt(ji) {
hu = window.location.search.substring(1);
gy = hu.split("&");
for (i = 0; i < gy.length; i++) {
ft = gy[i].split("=");
if (ft[0] == ji) {
return ft[1];
}
}
}
var koko = querySt("koko");
document.write(koko);
document.write("<br>");
document.write(hu);
This is a function to extract variables from the document’s query string, e.g. if the document’s location is
querySt("koko")will return123.As a side note, the function should use local variables to prevent polluting the global name space: