Click to See Complete Forum and Search --> : What's wrong here?
Zaphod64831
Jun 23rd, 2000, 06:43 AM
What's wrong with this code?
<script language="JavaScript"><!--
if (screen.width = 800){
if (screen.height = 600){
document.write "<BR><BR>";
}
}
if (screen.width = 1024){
if (screen.height = 768){
document.write "<BR><BR><BR>";
}
}
//--></script>
billyo
Jun 23rd, 2000, 03:04 PM
This fix should work in IE and NetScape. In javascript, to find out if two things are equal, you have to use a special comparison operator: "==". A plain equal sign assigns values, and says "this is that" but a double equal sign asks "is this that?" So your code works if'n you say
if (screen.width==800){whatever}
Zaphod64831
Jun 24th, 2000, 12:07 AM
I tried that, it still doesn't work.
noone
Jun 24th, 2000, 11:02 AM
Wouldn't you have to use parethesens?
document.write("xxxx");
Zaphod64831
Jun 24th, 2000, 11:33 AM
THANK YOU! It works now. Go to http://www.olemac.net/~hutch to see it in action.
noone
Jun 25th, 2000, 03:30 AM
Hey, I get a 404 error in the top frame it looks like:
Not Found
The requested URL /~hutch/msagent.html was not found on this server.
Apache/1.3.9 Server at http://www.olemac.net Port 80
And on a side not, those are some of the bad habits you can pick up from using VB too much :)
Zaphod64831
Jun 25th, 2000, 03:56 AM
I think it was just a naming error, and the top frame isn't supposed to be visible, what browser are you using? Does it work now?
noone
Jun 25th, 2000, 04:32 AM
I'm using Netscape and yup theres no error anymore. The top half of the page is just a blank frame.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.