Created
January 21, 2009 02:47
-
-
Save hotchpotch/49825 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment