H
HopfZ
Internet Explorer 6 bookmarklets(favlets) has size limit. And its size
limit depend on the kind of code.
For example, CODE A and CODE B (below) are both at their size limit.
CODE A does not work (as a bookmarklet), but if you replace the number
44444 at the end to 4444, then it works. CODE B is much longer than
CODE A, but if you replace OO in the regular expression to O, then it
works. I don't know why they have different size limits. Does anybody
know what kind of coding pattern increase or decrease the size limit?
CODE A (294 characters)
javascript
function(){ alert('start'); var t = "1"; t = t + 1 + 2 + 3
+ 4; t = t + 1 + 2 + 3 + 4; t = t + 1 + 2 + 3 + 4; t = t + 1 + 2 + 3 +
4; t = t + 1 + 2 + 3 + 4; t = t + 1 + 2 + 3 + 4; t = t + 1 + 2 + 3 + 4;
t = t + 1 + 2 + 3 + 4; t = 1; t = t + 111 + 22 + 33 + 44444;
alert('end');})();
CODE B (399 characters)
javascript
function(){ alert("start"); function getSel() { var t = "";
if (window.getSelection) { t = window.getSelection(); } else { if
(document.getSelection) { t = document.getSelection(); } else { if
(document.selection) { t = document.selection.createRange().text; }
else { return (""); } } } return ("" + t); } var textt = getSel(); var
re = /\:\s*(http\:\/\/\S+)\bOO/gi; alert("end:"); })();
limit depend on the kind of code.
For example, CODE A and CODE B (below) are both at their size limit.
CODE A does not work (as a bookmarklet), but if you replace the number
44444 at the end to 4444, then it works. CODE B is much longer than
CODE A, but if you replace OO in the regular expression to O, then it
works. I don't know why they have different size limits. Does anybody
know what kind of coding pattern increase or decrease the size limit?
CODE A (294 characters)
javascript
+ 4; t = t + 1 + 2 + 3 + 4; t = t + 1 + 2 + 3 + 4; t = t + 1 + 2 + 3 +
4; t = t + 1 + 2 + 3 + 4; t = t + 1 + 2 + 3 + 4; t = t + 1 + 2 + 3 + 4;
t = t + 1 + 2 + 3 + 4; t = 1; t = t + 111 + 22 + 33 + 44444;
alert('end');})();
CODE B (399 characters)
javascript
if (window.getSelection) { t = window.getSelection(); } else { if
(document.getSelection) { t = document.getSelection(); } else { if
(document.selection) { t = document.selection.createRange().text; }
else { return (""); } } } return ("" + t); } var textt = getSel(); var
re = /\:\s*(http\:\/\/\S+)\bOO/gi; alert("end:"); })();