simple JavaScript function to retrieve variables from the url