colicab-d
09-15-2004, 08:37 PM
It would seem so as after inserting a bit of my own js to the end of the template the site refershes and refershes and refreshe sin an endless fashion.
Whats going wrong and cananyone comment on a place within the code that this js can be placed to allow the styleid to be set automatically upon a users visit, be they guest admin or whatever..??
var bbcount= 0;
while (bbcount<1)
{
if ((screen.width>=1024) && (screen.height>=768))
{
window.location="?styleid=22";
bbcount=bbcount+1;
} else {
window.location="?styleid=21";
bbcount=bbcount+1;
}
alert('We are experiencing a Javascript Issue and will be back shortly');
}
The alert is there for my own testing needs and for end users. WHat confuses me further is the fact Ive added a working counter yet this is being ignored and the js is executed time and time again.
I take it because the page reloads to set the new id its then re-executing this js over again :p
Would it be wise to set a cookie with a value of 1 or 0 denpendant on if the script is run?
That way i could use an if and see if the value is there and if not this would then be excecuted creating a cookie with the "has been run" value ?
Whats going wrong and cananyone comment on a place within the code that this js can be placed to allow the styleid to be set automatically upon a users visit, be they guest admin or whatever..??
var bbcount= 0;
while (bbcount<1)
{
if ((screen.width>=1024) && (screen.height>=768))
{
window.location="?styleid=22";
bbcount=bbcount+1;
} else {
window.location="?styleid=21";
bbcount=bbcount+1;
}
alert('We are experiencing a Javascript Issue and will be back shortly');
}
The alert is there for my own testing needs and for end users. WHat confuses me further is the fact Ive added a working counter yet this is being ignored and the js is executed time and time again.
I take it because the page reloads to set the new id its then re-executing this js over again :p
Would it be wise to set a cookie with a value of 1 or 0 denpendant on if the script is run?
That way i could use an if and see if the value is there and if not this would then be excecuted creating a cookie with the "has been run" value ?