-
What's wrong with this code?
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>
-
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}
-
I tried that, it still doesn't work.
-
Wouldn't you have to use parethesens?
document.write("xxxx");
-
THANKS
THANK YOU! It works now. Go to http://www.olemac.net/~hutch to see it in action.
-
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 :)
-
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?
-
I'm using Netscape and yup theres no error anymore. The top half of the page is just a blank frame.