hotchpotch (owner)

Revisions

gist: 49825 Download_button fork
public
Public Clone URL: git://gist.github.com/49825.git
Embed All Files: show embed
HTML #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<html>
<head>
<title>url max langth</title>
<script type="text/javascript">
(function() {
var urlLen = location.href.length;
location.hash.match(/l=(\d+)/);
var len;
if (len = RegExp.$1) {
  len = len | 0;
  if (len > 10000 * 100)
    return alert('max length >= ' + len);
 
  if (urlLen == len) {
     len *= 2;
  } else {
     var l = (len / 2)|0;
     len = l + ((l/4)|0);
 
     if (len == urlLen) {
       alert('max length = ' + len);
       return;
     }
  }
} else {
  len = 1000;
}
var url = location.href;
url = url.substr(0, url.indexOf(location.hash));
var q = '#l=' + len + '&';
var aLen = len - q.length - url.length;
var a = '';
for (var i = 0; i < aLen; i++) a+= 'a';
url += q + a;
location.href = url;
location.reload();
})();
</script>
</head>
<body>
</body>
</html>