Valhalla Legends Forums Archive | Web Development | JavaScript

AuthorMessageTime
DrivE
I'm currently working on a project for a computer science class I am taking and am looking for somebody to review my work (Note: I didn't ask anybody to do it for me so don't start flaming me.) It is a simple addition to a website plugged into the source. If anybody knows anything about the language and is willing to check over my work please reply to this post and I'll post my project for you to review. Also there is one correction I don't know how to make and if you'd like to give that a shot and trying to explain it to me I would appreciate it. I'm sure the answer is right in front of me... I'm just not looking in the right place. Thank you.

!~!HaZaRD!~!
July 1, 2003, 1:09 PM
Zakath
What language is this dealing with?

Incidentally, this is a good example of the right way to ask for help, in my opinion.
July 2, 2003, 2:58 AM
Eibro
[quote author=Zakath link=board=5;threadid=1757;start=0#msg13502 date=1057114738]
What language is this dealing with?

Incidentally, this is a good example of the right way to ask for help, in my opinion.
[/quote]Re: Javascript
Check the thread title! :)
July 2, 2003, 4:15 AM
DrivE
[code]
<Script Language=JAVAScript Type="Text/javascript">
   myMsg="-:HaZarD NeT:";
      x=0;
         scrollMsg();
          function scrollMsg()    {
          window.status=myMsg.substring(x,myMsg.length) + myMsg.substring(0,x-1);
          if (x < myMsg.length)
             x++;
             else
          x=0;
    setTimeout("scrollMsg()",180);
           }
</Script>
[/code]

Ok I'll just let you all take a look at it. Yes I know this program is found in certain places on the web and I could just go steal it. The problem of course being this is going to be on my final and I need to actually know it. I know the script works but I'm looking for suggestions on it. Also, if you save the script as .html and look at it, it will not scroll along the entire bar, it is condensed in the lower left hand corner of the screen. If anybody can give me a push in the general direction of how to fix this problem I'd appreciate it. Feel free to point out any errors with the format of the script as well. Thanks.

!~!HaZaRD!~!
July 2, 2003, 1:08 PM
Camel
Well for starters, you could learn to indent properly. :)

[code]<Script Language=JAVAScript Type="Text/javascript">
myMsg="-:HaZarD NeT:";
x=0;
scrollMsg();
function scrollMsg()
{
   window.status=myMsg.substring(x,myMsg.length) + myMsg.substring(0,x-1);
   if (x < myMsg.length)
      x++;
   else
      x=0;
   setTimeout("scrollMsg()",180);
}
</Script>[/code]
July 3, 2003, 1:44 AM
DrivE
Bah... +1 to Camel for correcting my mistake. Thats the kind of stuff I want to know. Second, I ask again if anybody knows how to make the next scroll across the ENTIRE bar at the bottom of the screen rather than just the lower left hand corner?

!~!HaZaRD!~!
July 3, 2003, 2:08 AM
Noodlez
You want to know how to indent? Just indent everything that's nested.
Example
[code]
function(void)
{
->indent eveyrthing in here
->if{
->->double indent
->}//nest is closed, lose the indent
->do{
->->if{
->->->stuff
->->}
->}
}
[/code]
btw, incase you haven't figured it out -> is a tab
get it?
July 8, 2003, 9:15 AM
Camel
you're missing a "->}" :)
July 8, 2003, 10:47 PM
Noodlez
lies!
July 8, 2003, 11:34 PM
j0k3r
[quote]« Reply #7 on: Today at 05:47:19pm »
[/quote]
[quote]
« Last Edit: Today at 06:33:41pm by Noodlez »
[/quote]
;D

Indenting is only part of the curriculum/program in universities, I doubt your teacher will remove marks for it. However, it is good practice, makes it very much easier for any programmer to read.

Also, I don't know Java... Is scrollMsg previously defined? Cause if not then your only declaring it... but not calling it.
July 9, 2003, 1:22 AM
JoeCool
um.. get a book on it.. Java Script Coding For Dummies ;D
July 9, 2003, 2:47 AM
Camel
Any time someone asks me for help and shows me code, the first thing I tell them to do is indent. I would say at least two thirds of the time that alone solves their problem.
July 9, 2003, 6:47 PM
St0rm.iD
[quote author=j0k3r link=board=5;threadid=1757;start=0#msg14209 date=1057713729]
[quote]« Reply #7 on: Today at 05:47:19pm »
[/quote]
[quote]
« Last Edit: Today at 06:33:41pm by Noodlez »
[/quote]
;D

Indenting is only part of the curriculum/program in universities, I doubt your teacher will remove marks for it. However, it is good practice, makes it very much easier for any programmer to read.

Also, I don't know Java... Is scrollMsg previously defined? Cause if not then your only declaring it... but not calling it.
[/quote]

JavaScript != Java!!!
July 10, 2003, 4:38 PM
Camel
[quote author=St0rm.iD link=board=5;threadid=1757;start=0#msg14441 date=1057855133]
[quote author=j0k3r link=board=5;threadid=1757;start=0#msg14209 date=1057713729]
[quote]« Reply #7 on: Today at 05:47:19pm »
[/quote]
[quote]
« Last Edit: Today at 06:33:41pm by Noodlez »
[/quote]
;D

Indenting is only part of the curriculum/program in universities, I doubt your teacher will remove marks for it. However, it is good practice, makes it very much easier for any programmer to read.

Also, I don't know Java... Is scrollMsg previously defined? Cause if not then your only declaring it... but not calling it.
[/quote]

JavaScript != Java!!!
[/quote]

JavaScript = VBScript with Java syntax
VBScript = uber-stripped-down VBA
July 13, 2003, 11:14 PM
St0rm.iD
[quote author=Camel link=board=5;threadid=1757;start=0#msg14702 date=1058138095]
[quote author=St0rm.iD link=board=5;threadid=1757;start=0#msg14441 date=1057855133]
[quote author=j0k3r link=board=5;threadid=1757;start=0#msg14209 date=1057713729]
[quote]« Reply #7 on: Today at 05:47:19pm »
[/quote]
[quote]
« Last Edit: Today at 06:33:41pm by Noodlez »
[/quote]
;D

Indenting is only part of the curriculum/program in universities, I doubt your teacher will remove marks for it. However, it is good practice, makes it very much easier for any programmer to read.

Also, I don't know Java... Is scrollMsg previously defined? Cause if not then your only declaring it... but not calling it.
[/quote]

JavaScript != Java!!!
[/quote]

JavaScript = VBScript with Java syntax
VBScript = uber-stripped-down VBA
[/quote]

All lies.

JavaScript = new language with no relation to Java or VBScript, Microsoft just happened to make them both part of ActiveX scripting

VBScript = QBasic that can make viruses
July 14, 2003, 1:38 AM
Skywing
[quote author=St0rm.iD link=board=5;threadid=1757;start=0#msg14719 date=1058146697]
All lies.

JavaScript = new language with no relation to Java or VBScript, Microsoft just happened to make them both part of ActiveX scripting

VBScript = QBasic that can make viruses
[/quote]

By the way, Netscape created JavaScript. Microsoft created JScript, which is similar but not entirely compatible.
July 14, 2003, 2:21 AM

Search