JS convertation of window query string to JSON format