Personal computing discussed

Moderators: renee, SecretSquirrel, just brew it!

 
mac_h8r1
Minister of Gerbil Affairs
Topic Author
Posts: 2974
Joined: Tue Sep 24, 2002 6:57 pm
Location: Somewhere in the Cloud
Contact:

Does JScript work in all browsers?

Sun Mar 14, 2004 1:10 pm

My friend and I cowrote the JavaScript for our High-School's Jewish Student Union website.

http://vannuysjews.sytes.net

<head>
   <script language"JavaScript">
   <!--
      //####################################################
      var t=new String("Welcome to VNHS JSU Central! ");   //marquee
      var nc=29;                  //number of chars in marquee
      var ms=new Array(               //messages
         "Come Visit Us",
         "Friday at Lunch",
         "Room 218"
      );
      var nm=3;                  //number of messages
      var mx=1;                  //which message to start with
      //####################################################
      var m=ms[--mx];
      var x=0;
      var timerID=null;
      function loadTitle()
      {
         document.title="["+t+"] "+m;
         x++;
         rotate();
         timerID=setTimeout("loadTitle()",200);
         if (x==nc)
         {
            x=0;
            if(mx==nm-1) mx=-1;
            m=ms[++mx];
         }
      }
      function rotate()
      {
         var s=new String("");
         for(var i=1;i<t.length;i++)
         {
            s=s.concat(t.substr(i,1));
         }
         s=s.concat(t.substr(0,1));
         t=s;
      }
   //-->
   </script>
   <style>
   #main {width:700px;background-color:#FFFFFF;
      border:3px dashed #FFFF00;margin-left:10px;
      padding:5px;}
   </style>
</head>
<body onload="loadTitle();" bgcolor="#001F56" topmargin="0" leftmargin="0" link="FFFFFF">


I need to know if it works in all browsers. Lemme know, guys & gals, thanks.
mac_h8r1.postCount++;
Chaos reigns within. Reflect, repent, and reboot. Order shall return.
Slivovitz owns you.
 
derFunkenstein
Gerbil God
Posts: 25427
Joined: Fri Feb 21, 2003 9:13 pm
Location: Comin' to you directly from the Mothership

Sun Mar 14, 2004 1:25 pm

It scrolls the name across the tab in Firefox 0.8...and the other messages show up to the right of it...is that what you're looking for it to do?
I do not understand what I do. For what I want to do I do not do, but what I hate I do.
Twittering away the day at @TVsBen
 
mac_h8r1
Minister of Gerbil Affairs
Topic Author
Posts: 2974
Joined: Tue Sep 24, 2002 6:57 pm
Location: Somewhere in the Cloud
Contact:

Sun Mar 14, 2004 1:32 pm

Yes. It should scroll "Welcome to VNHS JSU Central!" and the message to the right should switch from "Come Visit Us" to "Fridays at Lunch" to "Room 218". It switches every time it scrolls through, so yes, that's what it should do.
mac_h8r1.postCount++;
Chaos reigns within. Reflect, repent, and reboot. Order shall return.
Slivovitz owns you.
 
derFunkenstein
Gerbil God
Posts: 25427
Joined: Fri Feb 21, 2003 9:13 pm
Location: Comin' to you directly from the Mothership

Sun Mar 14, 2004 1:37 pm

works for me in IE 6SP1 with all patches, too
I do not understand what I do. For what I want to do I do not do, but what I hate I do.
Twittering away the day at @TVsBen
 
liar
Gerbil Elite
Posts: 636
Joined: Thu Mar 06, 2003 3:35 pm
Location: Concord,CA.

Sun Mar 14, 2004 1:42 pm

Works in an older version of Firebird (Gecko/20031210 Firebird/0.7+) also.
Sancte Isidore, ora pro nobis!
Caveat lector.
 
mac_h8r1
Minister of Gerbil Affairs
Topic Author
Posts: 2974
Joined: Tue Sep 24, 2002 6:57 pm
Location: Somewhere in the Cloud
Contact:

Sun Mar 14, 2004 2:03 pm

Excellent. Thx so far for the replies. Anybody know about Opera? My friend said she didn't see it, but she isn't exactly computer literate, so she may have been looking at a scroll bar for all I know.
mac_h8r1.postCount++;
Chaos reigns within. Reflect, repent, and reboot. Order shall return.
Slivovitz owns you.
 
getbornagain
Graphmaster Gerbil
Posts: 1027
Joined: Wed May 08, 2002 8:49 pm
Location: kansas

Sun Mar 14, 2004 2:26 pm

well it working is netscape 7.1 [Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)]

but the window thingy on the page is filled with the word "content"
 
mac_h8r1
Minister of Gerbil Affairs
Topic Author
Posts: 2974
Joined: Tue Sep 24, 2002 6:57 pm
Location: Somewhere in the Cloud
Contact:

Sun Mar 14, 2004 2:30 pm

yeah, it should be. it's under heavy construction

check out the source, if you want.
mac_h8r1.postCount++;
Chaos reigns within. Reflect, repent, and reboot. Order shall return.
Slivovitz owns you.
 
morphine
TR Staff
Posts: 11600
Joined: Fri Dec 27, 2002 8:51 pm
Location: Portugal (that's next to Spain)

Sun Mar 14, 2004 7:07 pm

Doesn't seem to do anything at all in Opera 7.23 :-?

Specifying what version of JS it's targeted to may be of some help.
 
Yahoolian
Grand Gerbil Poohbah
Posts: 3577
Joined: Sun Feb 16, 2003 3:43 pm
Location: MD
Contact:

Sun Mar 14, 2004 7:30 pm

Apparently, if you don't have <title> and </title> then it doesn't work in Opera.

Here you go:

<html>
<head>
   <title>
   JSU Central
   </title>
   <script language"JavaScript">
   <!--
      //####################################################
      var t=new String("Welcome to VNHS JSU Central! ");   //marquee
      var nc=29;                  //number of chars in marquee
      var ms=new Array(               //messages
         "Come Visit Us",
         "Friday at Lunch",
         "Room 218"
      );
      var nm=3;                  //number of messages
      var mx=1;                  //which message to start with
      //####################################################
      var m=ms[--mx];
      var x=0;
      var timerID=null;
      function loadTitle()
      {
         document.title="["+t+"] "+m;
         x++;
         rotate();
         timerID=setTimeout("loadTitle()",200);
         if (x==nc)
         {
            x=0;
            if(mx==nm-1) mx=-1;
            m=ms[++mx];
         }
      }
      function rotate()
      {
         var s=new String("");
         for(var i=1;i<t.length;i++)
         {
            s=s.concat(t.substr(i,1));
         }
         s=s.concat(t.substr(0,1));
         t=s;
      }
   //-->
   </script>
   <style>
   #main {width:700px;background-color:#FFFFFF;
      border:3px dashed #FFFF00;margin-left:10px;
      padding:5px;}
   </style>
</head>
<body onload="loadTitle();" bgcolor="#001F56" topmargin="0" leftmargin="0" link="FFFFFF">
</body>
</html>



I'd recommend against the marquee, it would seem to distract users from the main content...
 
fc34
Minister of Gerbil Affairs
Posts: 2816
Joined: Wed May 08, 2002 8:39 am
Location: Somewhere

Mon Mar 15, 2004 5:46 am

Seems to work fine...
Windows XP - The 64-bit wannabe with a 32-bit graphics interface for 16-bit extensions to a 8-bit patch on a 4-bit operating system designed to run on a 2-bit processor by a company that can't stand 1-bit of competition

Who is online

Users browsing this forum: No registered users and 1 guest
GZIP: On