Loading ...
Sorry, an error occurred while loading the content.

screen redirection script

Expand Messages
  • osman_azizi
    I have these scrip, it works ok but just with those screen resolution. If u try to put more, lets say 1280x720 and 1280x960 then it dosent work, it will send
    Message 1 of 10 , Oct 30, 2008
    • 0 Attachment
      I have these scrip, it works ok but just with those screen resolution.
      If u try to put more, lets say 1280x720 and 1280x960 then it dosent
      work, it will send you to 1024x768 even if you have any of the other
      resolution.
      So, then, what i wrote wrong on the scrip?, or if there other one that
      workd with more screen resolutions?

      Thanks

      <script language="JavaScript1.2">
      <!--
      if (screen.width==800||screen.height==600) //if 800x600
      window.location.replace("http://adworldcorp.com/800x600.html")
      else if (screen.width==1024||screen.height==768) //if 1024x768
      window.location.replace("http://adworldcorp.com/1024x768.html")
      else //if all else
      window.location.replace("http://adworldcorp.com/1280x1024.html")
      //-->
      </script>
    • David Smart
      What are the values you are getting from screen.width and screen.height? What browser and level are you using? Regards, Dave S ... From: osman_azizi
      Message 2 of 10 , Nov 1, 2008
      • 0 Attachment
        What are the values you are getting from screen.width and screen.height?
        What browser and level are you using?

        Regards, Dave S

        ----- Original Message -----
        From: "osman_azizi" <osman_azizi@...>
        To: <JavaScript_Official@yahoogroups.com>
        Sent: Friday, October 31, 2008 9:57 AM
        Subject: [JavaScript] screen redirection script


        >I have these scrip, it works ok but just with those screen resolution.
        > If u try to put more, lets say 1280x720 and 1280x960 then it dosent
        > work, it will send you to 1024x768 even if you have any of the other
        > resolution.
        > So, then, what i wrote wrong on the scrip?, or if there other one that
        > workd with more screen resolutions?
        >
        > Thanks
        >
        > <script language="JavaScript1.2">
        > <!--
        > if (screen.width==800||screen.height==600) //if 800x600
        > window.location.replace("http://adworldcorp.com/800x600.html")
        > else if (screen.width==1024||screen.height==768) //if 1024x768
        > window.location.replace("http://adworldcorp.com/1024x768.html")
        > else //if all else
        > window.location.replace("http://adworldcorp.com/1280x1024.html")
        > //-->
        > </script>
        >
        >
        > ------------------------------------
        >
        > Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
        >
        >
        >
      • abhijit_dutta2003
        ... The reason is pretty obvious. You are using the or operator (||) where you should be using the and operator (&&).
        Message 3 of 10 , Nov 2, 2008
        • 0 Attachment
          --- In JavaScript_Official@yahoogroups.com, "osman_azizi"
          <osman_azizi@...> wrote:
          >
          > I have these scrip, it works ok but just with those screen resolution.
          > If u try to put more, lets say 1280x720 and 1280x960 then it dosent
          > work, it will send you to 1024x768 even if you have any of the other
          > resolution.
          > So, then, what i wrote wrong on the scrip?, or if there other one that
          > workd with more screen resolutions?
          >
          > Thanks
          >
          > <script language="JavaScript1.2">
          > <!--
          > if (screen.width==800||screen.height==600) //if 800x600
          > window.location.replace("http://adworldcorp.com/800x600.html")
          > else if (screen.width==1024||screen.height==768) //if 1024x768
          > window.location.replace("http://adworldcorp.com/1024x768.html")
          > else //if all else
          > window.location.replace("http://adworldcorp.com/1280x1024.html")
          > //-->
          > </script>
          >
          The reason is pretty obvious. You are using the 'or' operator (||)
          where you should be using the 'and' operator (&&).
        • Tim Sabin
          Your code does an or (||) I don t think you want to do that. You want and (&&). --Tim Sabin
          Message 4 of 10 , Nov 2, 2008
          • 0 Attachment
            Your code does an "or" (||) I don't think you want to do that. You want
            "and" (&&).

            --Tim Sabin


            osman_azizi wrote:
            > I have these scrip, it works ok but just with those screen resolution.
            > If u try to put more, lets say 1280x720 and 1280x960 then it dosent
            > work, it will send you to 1024x768 even if you have any of the other
            > resolution.
            > So, then, what i wrote wrong on the scrip?, or if there other one that
            > workd with more screen resolutions?
            >
            > Thanks
            >
            > <script language="JavaScript1.2">
            > <!--
            > if (screen.width==800||screen.height==600) //if 800x600
            > window.location.replace("http://adworldcorp.com/800x600.html")
            > else if (screen.width==1024||screen.height==768) //if 1024x768
            > window.location.replace("http://adworldcorp.com/1024x768.html")
            > else //if all else
            > window.location.replace("http://adworldcorp.com/1280x1024.html")
            > //-->
            > </script>
            >
            >
            > ------------------------------------
            >
            > Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
            >
            >
            >
            >
            >
          • osman_azizi
            Dear Tim I am trying to understand the tecnical english, so i am having hard time to understand the or and and . Please give me a little more explanation
            Message 5 of 10 , Nov 2, 2008
            • 0 Attachment
              Dear Tim

              I am trying to understand the tecnical english, so i am having hard
              time to understand the "or" and "and". Please give me a little more
              explanation or a live example of the scrip.

              Thanks


              --- In JavaScript_Official@yahoogroups.com, Tim Sabin <tim@...> wrote:
              >
              > Your code does an "or" (||) I don't think you want to do that. You
              want
              > "and" (&&).
              >
              > --Tim Sabin
              >
              >
              > osman_azizi wrote:
              > > I have these scrip, it works ok but just with those screen
              resolution.
              > > If u try to put more, lets say 1280x720 and 1280x960 then it
              dosent
              > > work, it will send you to 1024x768 even if you have any of the
              other
              > > resolution.
              > > So, then, what i wrote wrong on the scrip?, or if there other one
              that
              > > workd with more screen resolutions?
              > >
              > > Thanks
              > >
              > > <script language="JavaScript1.2">
              > > <!--
              > > if (screen.width==800||screen.height==600) //if 800x600
              > > window.location.replace("http://adworldcorp.com/800x600.html")
              > > else if (screen.width==1024||screen.height==768) //if 1024x768
              > > window.location.replace("http://adworldcorp.com/1024x768.html")
              > > else //if all else
              > > window.location.replace("http://adworldcorp.com/1280x1024.html")
              > > //-->
              > > </script>
              > >
              > >
              > > ------------------------------------
              > >
              > > Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
              > >
              > >
              > >
              > >
              > >
              >
            • Tim Sabin
              This is Boolean logic, not English. Boolean AND: AND 0 1 ... 0 0 0 1 0 1 Boolean OR: OR 0 1 ... 0 0 1 1 1 1 This is Computer Science 101
              Message 6 of 10 , Nov 3, 2008
              • 0 Attachment
                This is Boolean logic, not English. Boolean AND:
                AND 0 1
                ---------
                0 0 0
                1 0 1

                Boolean OR:
                OR 0 1
                ---------
                0 0 1
                1 1 1
                This is Computer Science 101 stuff. You're either in school or you
                should go back.

                --Tim Sabin


                > Dear Tim
                >
                > I am trying to understand the tecnical english, so i am having hard
                > time to understand the "or" and "and". Please give me a little more
                > explanation or a live example of the scrip.
                >
                > Thanks
                >
                >
                > --- In JavaScript_Official@yahoogroups.com, Tim Sabin <tim@...>
                wrote:
                > >
                > > Your code does an "or" (||) I don't think you want to do that. You
                > want
                > > "and" (&&).
                > >
                > > --Tim Sabin
                > >
                > >
                > > osman_azizi wrote:
                > > > I have these scrip, it works ok but just with those screen
                > resolution.
                > > > If u try to put more, lets say 1280x720 and 1280x960 then it
                > dosent
                > > > work, it will send you to 1024x768 even if you have any of the
                > other
                > > > resolution.
                > > > So, then, what i wrote wrong on the scrip?, or if there other
                one
                > that
                > > > workd with more screen resolutions?
                > > >
                > > > Thanks
                > > >
                > > > <script language="JavaScript1.2">
                > > > <!--
                > > > if (screen.width==800||screen.height==600) //if 800x600
                > > > window.location.replace("http://adworldcorp.com/800x600.html")
                > > > else if (screen.width==1024||screen.height==768) //if 1024x768
                > > > window.location.replace("http://adworldcorp.com/1024x768.html")
                > > > else //if all else
                > > > window.location.replace("http://adworldcorp.com/1280x1024.html")
                > > > //-->
                > > > </script>
                > > >
                > > >
                > > > ------------------------------------
                > > >
                > > > Visit http://aiaiai.com for more groups to joinYahoo! Groups
                Links
                > > >
                > > >
                > > >
                > > >
                > > >
                > >
                >
                >
                >
                > ------------------------------------
                >
                > Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
                >
                >
                >
                >

                --Tim Sabin
              • David Smart
                ... Umm ... not if it s sending 1280x720 or 1280x960 to 1024x768. OR or AND doesn t make any difference because neither part is true. Osman, what are the
                Message 7 of 10 , Nov 3, 2008
                • 0 Attachment
                  > The reason is pretty obvious. You are using the 'or' operator (||)
                  > where you should be using the 'and' operator (&&).

                  Umm ... not if it's sending 1280x720 or 1280x960 to 1024x768. OR or AND
                  doesn't make any difference because neither part is true.

                  Osman, what are the values returned by screen.width and screen.height when
                  you have problems?

                  Regards, Dave S

                  ----- Original Message -----
                  From: "abhijit_dutta2003" <abhijit_dutta2003@...>
                  To: <JavaScript_Official@yahoogroups.com>
                  Sent: Sunday, November 02, 2008 9:05 PM
                  Subject: [JavaScript] Re: screen redirection script


                  > --- In JavaScript_Official@yahoogroups.com, "osman_azizi"
                  > <osman_azizi@...> wrote:
                  >>
                  >> I have these scrip, it works ok but just with those screen resolution.
                  >> If u try to put more, lets say 1280x720 and 1280x960 then it dosent
                  >> work, it will send you to 1024x768 even if you have any of the other
                  >> resolution.
                  >> So, then, what i wrote wrong on the scrip?, or if there other one that
                  >> workd with more screen resolutions?
                  >>
                  >> Thanks
                  >>
                  >> <script language="JavaScript1.2">
                  >> <!--
                  >> if (screen.width==800||screen.height==600) //if 800x600
                  >> window.location.replace("http://adworldcorp.com/800x600.html")
                  >> else if (screen.width==1024||screen.height==768) //if 1024x768
                  >> window.location.replace("http://adworldcorp.com/1024x768.html")
                  >> else //if all else
                  >> window.location.replace("http://adworldcorp.com/1280x1024.html")
                  >> //-->
                  >> </script>
                  >>
                  > The reason is pretty obvious. You are using the 'or' operator (||)
                  > where you should be using the 'and' operator (&&).
                  >
                  >
                  >
                  > ------------------------------------
                  >
                  > Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
                  >
                  >
                  >
                • osman_azizi
                  Dear Tim In a answer to your question where I should go back to school i have to say, that i have never attent a computer science 101 since i didt study
                  Message 8 of 10 , Nov 7, 2008
                  • 0 Attachment
                    Dear Tim

                    In a answer to your question where I should go back to school i have
                    to say, that i have never attent a computer science 101 since i didt
                    study comuper stuff. If I ask, and most here do, is because we dont
                    know. I tough these newsgroup was for helping javascript users but
                    it looks like these newsgroup if not made for the ones that dosent
                    know. I guess it must be a rule to be in these newsgroup, maybe to
                    have a degreee in computer.

                    --- In JavaScript_Official@yahoogroups.com, "Tim Sabin" <tim@...>
                    wrote:
                    >
                    > This is Boolean logic, not English. Boolean AND:
                    > AND 0 1
                    > ---------
                    > 0 0 0
                    > 1 0 1
                    >
                    > Boolean OR:
                    > OR 0 1
                    > ---------
                    > 0 0 1
                    > 1 1 1
                    > This is Computer Science 101 stuff. You're either in school or you
                    > should go back.
                    >
                    > --Tim Sabin
                    >
                    >
                    > > Dear Tim
                    > >
                    > > I am trying to understand the tecnical english, so i am having
                    hard
                    > > time to understand the "or" and "and". Please give me a little
                    more
                    > > explanation or a live example of the scrip.
                    > >
                    > > Thanks
                    > >
                    > >
                    > > --- In JavaScript_Official@yahoogroups.com, Tim Sabin <tim@>
                    > wrote:
                    > > >
                    > > > Your code does an "or" (||) I don't think you want to do that.
                    You
                    > > want
                    > > > "and" (&&).
                    > > >
                    > > > --Tim Sabin
                    > > >
                    > > >
                    > > > osman_azizi wrote:
                    > > > > I have these scrip, it works ok but just with those screen
                    > > resolution.
                    > > > > If u try to put more, lets say 1280x720 and 1280x960 then it
                    > > dosent
                    > > > > work, it will send you to 1024x768 even if you have any of
                    the
                    > > other
                    > > > > resolution.
                    > > > > So, then, what i wrote wrong on the scrip?, or if there other
                    > one
                    > > that
                    > > > > workd with more screen resolutions?
                    > > > >
                    > > > > Thanks
                    > > > >
                    > > > > <script language="JavaScript1.2">
                    > > > > <!--
                    > > > > if (screen.width==800||screen.height==600) //if 800x600
                    > > > > window.location.replace("http://adworldcorp.com/800x600.html")
                    > > > > else if (screen.width==1024||screen.height==768) //if 1024x768
                    > > > > window.location.replace
                    ("http://adworldcorp.com/1024x768.html")
                    > > > > else //if all else
                    > > > > window.location.replace
                    ("http://adworldcorp.com/1280x1024.html")
                    > > > > //-->
                    > > > > </script>
                    > > > >
                    > > > >
                    > > > > ------------------------------------
                    > > > >
                    > > > > Visit http://aiaiai.com for more groups to joinYahoo! Groups
                    > Links
                    > > > >
                    > > > >
                    > > > >
                    > > > >
                    > > > >
                    > > >
                    > >
                    > >
                    > >
                    > > ------------------------------------
                    > >
                    > > Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
                    > >
                    > >
                    > >
                    > >
                    >
                    > --Tim Sabin
                    >
                  • Tim Sabin
                    I m not trying to be mean or nasty . :-) It s just that this group is about JavaScript, not basic computer programming. I m happy to help out with
                    Message 9 of 10 , Nov 10, 2008
                    • 0 Attachment
                      I'm not trying to be "mean" or "nasty". :-)

                      It's just that this group is about JavaScript, not basic computer
                      programming. I'm happy to help out with JavaScript problems by
                      explaining them in terms that all here are expected to know; in this
                      case Boolean Logic ("AND" and "OR"). Boolean Logic is one of the
                      foundations for *all* computer programming (server, client, and stand-
                      alone. You don't have to have a degree; just understand what someone
                      is talking about when they talk about basics.

                      If you need help understanding this, you have a couple of options: 1)
                      get yourself a good Intro to Computer Science (or Programming) book,
                      or 2) go to a university or community college and attend their
                      Computer Science 101 course.

                      Good luck!

                      --Tim Sabin


                      > Dear Tim
                      >
                      > In a answer to your question where I should go back to school i have
                      > to say, that i have never attent a computer science 101 since i didt
                      > study comuper stuff. If I ask, and most here do, is because we dont
                      > know. I tough these newsgroup was for helping javascript users but
                      > it looks like these newsgroup if not made for the ones that dosent
                      > know. I guess it must be a rule to be in these newsgroup, maybe to
                      > have a degreee in computer.
                      >
                      > --- In JavaScript_Official@yahoogroups.com, "Tim Sabin" <tim@...>
                      > wrote:
                      > >
                      > > This is Boolean logic, not English. Boolean AND:
                      > > AND 0 1
                      > > ---------
                      > > 0 0 0
                      > > 1 0 1
                      > >
                      > > Boolean OR:
                      > > OR 0 1
                      > > ---------
                      > > 0 0 1
                      > > 1 1 1
                      > > This is Computer Science 101 stuff. You're either in school or you
                      > > should go back.
                      > >
                      > > --Tim Sabin
                      > >
                      > >
                      > > > Dear Tim
                      > > >
                      > > > I am trying to understand the tecnical english, so i am having
                      > hard
                      > > > time to understand the "or" and "and". Please give me a little
                      > more
                      > > > explanation or a live example of the scrip.
                      > > >
                      > > > Thanks
                      > > >
                      > > >
                      > > > --- In JavaScript_Official@yahoogroups.com, Tim Sabin <tim@>
                      > > wrote:
                      > > > >
                      > > > > Your code does an "or" (||) I don't think you want to do that.
                      > You
                      > > > want
                      > > > > "and" (&&).
                      > > > >
                      > > > > --Tim Sabin
                      > > > >
                      > > > >
                      > > > > osman_azizi wrote:
                      > > > > > I have these scrip, it works ok but just with those screen
                      > > > resolution.
                      > > > > > If u try to put more, lets say 1280x720 and 1280x960 then it
                      > > > dosent
                      > > > > > work, it will send you to 1024x768 even if you have any of
                      > the
                      > > > other
                      > > > > > resolution.
                      > > > > > So, then, what i wrote wrong on the scrip?, or if there
                      other
                      > > one
                      > > > that
                      > > > > > workd with more screen resolutions?
                      > > > > >
                      > > > > > Thanks
                      > > > > >
                      > > > > > <script language="JavaScript1.2">
                      > > > > > <!--
                      > > > > > if (screen.width==800||screen.height==600) //if 800x600
                      > > > > > window.location.replace
                      ("http://adworldcorp.com/800x600.html")
                      > > > > > else if (screen.width==1024||screen.height==768) //if
                      1024x768
                      > > > > > window.location.replace
                      > ("http://adworldcorp.com/1024x768.html")
                      > > > > > else //if all else
                      > > > > > window.location.replace
                      > ("http://adworldcorp.com/1280x1024.html")
                      > > > > > //-->
                      > > > > > </script>
                      > > > > >
                      > > > > >
                      > > > > > ------------------------------------
                      > > > > >
                      > > > > > Visit http://aiaiai.com for more groups to joinYahoo! Groups
                      > > Links
                      > > > > >
                      > > > > >
                      > > > > >
                      > > > > >
                      > > > > >
                      > > > >
                      > > >
                      > > >
                      > > >
                      > > > ------------------------------------
                      > > >
                      > > > Visit http://aiaiai.com for more groups to joinYahoo! Groups
                      Links
                      > > >
                      > > >
                      > > >
                      > > >
                      > >
                      > > --Tim Sabin
                      > >
                      >
                      >
                      >
                      > ------------------------------------
                      >
                      > Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
                      >
                      >
                      >
                      >
                    • Lee Mahan
                      Not necessary a degree, but some of the basic knowledge when it comes to programming, and boolean algebra. There are soooo many dummy books out there and that
                      Message 10 of 10 , Nov 10, 2008
                      • 0 Attachment
                        Not necessary a degree, but some of the basic knowledge when it comes to
                        programming, and boolean algebra. There are soooo many dummy books out
                        there and that is where you should start. Even better is the O'Reilly
                        series of books. Tim is right.

                        osman_azizi wrote:
                        >
                        > Dear Tim
                        >
                        > In a answer to your question where I should go back to school i have
                        > to say, that i have never attent a computer science 101 since i didt
                        > study comuper stuff. If I ask, and most here do, is because we dont
                        > know. I tough these newsgroup was for helping javascript users but
                        > it looks like these newsgroup if not made for the ones that dosent
                        > know. I guess it must be a rule to be in these newsgroup, maybe to
                        > have a degreee in computer.
                        >
                        > --- In JavaScript_Official@yahoogroups.com
                        > <mailto:JavaScript_Official%40yahoogroups.com>, "Tim Sabin" <tim@...>
                        > wrote:
                        > >
                        > > This is Boolean logic, not English. Boolean AND:
                        > > AND 0 1
                        > > ---------
                        > > 0 0 0
                        > > 1 0 1
                        > >
                        > > Boolean OR:
                        > > OR 0 1
                        > > ---------
                        > > 0 0 1
                        > > 1 1 1
                        > > This is Computer Science 101 stuff. You're either in school or you
                        > > should go back.
                        > >
                        > > --Tim Sabin
                        > >
                        > >
                        > > > Dear Tim
                        > > >
                        > > > I am trying to understand the tecnical english, so i am having
                        > hard
                        > > > time to understand the "or" and "and". Please give me a little
                        > more
                        > > > explanation or a live example of the scrip.
                        > > >
                        > > > Thanks
                        > > >
                        > > >
                        > > > --- In JavaScript_Official@yahoogroups.com
                        > <mailto:JavaScript_Official%40yahoogroups.com>, Tim Sabin <tim@>
                        > > wrote:
                        > > > >
                        > > > > Your code does an "or" (||) I don't think you want to do that.
                        > You
                        > > > want
                        > > > > "and" (&&).
                        > > > >
                        > > > > --Tim Sabin
                        > > > >
                        > > > >
                        > > > > osman_azizi wrote:
                        > > > > > I have these scrip, it works ok but just with those screen
                        > > > resolution.
                        > > > > > If u try to put more, lets say 1280x720 and 1280x960 then it
                        > > > dosent
                        > > > > > work, it will send you to 1024x768 even if you have any of
                        > the
                        > > > other
                        > > > > > resolution.
                        > > > > > So, then, what i wrote wrong on the scrip?, or if there other
                        > > one
                        > > > that
                        > > > > > workd with more screen resolutions?
                        > > > > >
                        > > > > > Thanks
                        > > > > >
                        > > > > > <script language="JavaScript1.2">
                        > > > > > <!--
                        > > > > > if (screen.width==800||screen.height==600) //if 800x600
                        > > > > > window.location.replace("http://adworldcorp.com/800x600.html
                        > <http://adworldcorp.com/800x600.html>")
                        > > > > > else if (screen.width==1024||screen.height==768) //if 1024x768
                        > > > > > window.location.replace
                        > ("http://adworldcorp.com/1024x768.html
                        > <http://adworldcorp.com/1024x768.html>")
                        > > > > > else //if all else
                        > > > > > window.location.replace
                        > ("http://adworldcorp.com/1280x1024.html
                        > <http://adworldcorp.com/1280x1024.html>")
                        > > > > > //-->
                        > > > > > </script>
                        > > > > >
                        > > > > >
                        > > > > > ------------------------------------
                        > > > > >
                        > > > > > Visit http://aiaiai.com <http://aiaiai.com> for more groups to
                        > joinYahoo! Groups
                        > > Links
                        > > > > >
                        > > > > >
                        > > > > >
                        > > > > >
                        > > > > >
                        > > > >
                        > > >
                        > > >
                        > > >
                        > > > ------------------------------------
                        > > >
                        > > > Visit http://aiaiai.com <http://aiaiai.com> for more groups to
                        > joinYahoo! Groups Links
                        > > >
                        > > >
                        > > >
                        > > >
                        > >
                        > > --Tim Sabin
                        > >
                        >
                        >
                        > ------------------------------------------------------------------------
                        >
                        >
                        > No virus found in this incoming message.
                        > Checked by AVG.
                        > Version: 8.0.101 / Virus Database: 270.9.0/1778 - Release Date: 11/9/2008 2:14 PM
                        >


                        [Non-text portions of this message have been removed]
                      Your message has been successfully submitted and would be delivered to recipients shortly.