[jQuery] Out of memory in IE8
Any suggestion on how to modify this script to get rif of the Out of
Memory error:
<script type="text/javascript">
var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus){
if(readCookie("sid")){return;}
createCookie("sid", "sid");
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*
(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*
((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=
(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null)
{myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" +
myleft +
",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open
(mypage,myname,settings);
win.blur();}
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring
(nameEQ.length,c.length);
}
return null;
}
function eraseCookie(name) {
createCookie(name,"",-1);
}
$(document).ready(function () {
$(document).click(function (){$("#cookwin").click();});
});
</script>
... is supposed to open a given link once per session with any click
on the page that has the code included, anywhere, not only on links.
And it works just fine with Chrome and FF3, only the IE8 gives the
error (though it loads the link).
The error appears for any version above jquery-1.2.6.pack.js; below
this it doesn't give the out of memory alert but it also does nothing
in IE8.
If you try to help, please consider I'm a noob and be very explicit.
Thanks!