Results 1 to 8 of 8

Thread: What's wrong here?

  1. #1

    Thread Starter
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268

    Question

    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>
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

  2. #2
    Junior Member
    Join Date
    May 2000
    Posts
    28

    Wink

    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}

  3. #3

    Thread Starter
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268
    I tried that, it still doesn't work.
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

  4. #4
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    292
    Wouldn't you have to use parethesens?
    document.write("xxxx");
    "People who think they know everything are a great annoyance to those of us who do."

  5. #5

    Thread Starter
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268

    THANKS

    THANK YOU! It works now. Go to http://www.olemac.net/~hutch to see it in action.
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

  6. #6
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    292
    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
    "People who think they know everything are a great annoyance to those of us who do."

  7. #7

    Thread Starter
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268
    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?
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

  8. #8
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    292
    I'm using Netscape and yup theres no error anymore. The top half of the page is just a blank frame.
    "People who think they know everything are a great annoyance to those of us who do."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width