Hi there!
I was typing some lines of code to tell the visitor of my site what is the resolution of his screen, so he could change it or not to the one I'm using for my web site. Here the sample :
<script language="JavaScript">
<!--
var width=screen.availWidth;
var height=screen.availHeight;
function condition()
{
if (width >= 1024 && height >= 768)
{
alert('Width : ' + width + '\n'
+ 'Height : ' + height);
}
else
{
alert('Width : ' + width + '\n'
+ 'Height : ' + height + '\n'
+ '\nYou´d better change your'
+ '\nresolution to 1024 x 768'
+ '\n\nThat way, your experience on'
+ '\nthis web site will be better.');
}
}
//-->
</script>
<a href="" onClick="alert(condition())">Want to see your resolution?</a>
My question is why am I always getting a second alert box with the string "undefined" in it? I tried to get rid of it but I failed. Help on this one will not be refused.
wolfmah
wolfmah@wolfmahheaven.net
I was typing some lines of code to tell the visitor of my site what is the resolution of his screen, so he could change it or not to the one I'm using for my web site. Here the sample :
<script language="JavaScript">
<!--
var width=screen.availWidth;
var height=screen.availHeight;
function condition()
{
if (width >= 1024 && height >= 768)
{
alert('Width : ' + width + '\n'
+ 'Height : ' + height);
}
else
{
alert('Width : ' + width + '\n'
+ 'Height : ' + height + '\n'
+ '\nYou´d better change your'
+ '\nresolution to 1024 x 768'
+ '\n\nThat way, your experience on'
+ '\nthis web site will be better.');
}
}
//-->
</script>
<a href="" onClick="alert(condition())">Want to see your resolution?</a>
My question is why am I always getting a second alert box with the string "undefined" in it? I tried to get rid of it but I failed. Help on this one will not be refused.
wolfmah
wolfmah@wolfmahheaven.net