OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var QueryString = function() { | 5 var QueryString = function() { |
6 // Allows access to query parameters on the URL; e.g., given a URL like: | 6 // Allows access to query parameters on the URL; e.g., given a URL like: |
7 // http://<server>/my.html?test=123&bob=123 | 7 // http://<server>/my.html?test=123&bob=123 |
8 // Parameters can then be accessed via QueryString.test or QueryString.bob. | 8 // Parameters can then be accessed via QueryString.test or QueryString.bob. |
9 var params = {}; | 9 var params = {}; |
10 // RegEx to split out values by &. | 10 // RegEx to split out values by &. |
(...skipping 30 matching lines...) Expand all Loading... |
41 element.addEventListener(event, function(e) { | 41 element.addEventListener(event, function(e) { |
42 setResultInTitle(event.toString()); | 42 setResultInTitle(event.toString()); |
43 }, false); | 43 }, false); |
44 } | 44 } |
45 | 45 |
46 function convertToArray(input) { | 46 function convertToArray(input) { |
47 if (Array.isArray(input)) | 47 if (Array.isArray(input)) |
48 return input; | 48 return input; |
49 return [input]; | 49 return [input]; |
50 } | 50 } |
OLD | NEW |