Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - JavaScript!
  
User name:
Password:
Reply:
 

UserPost
HyperLamer
Posts: 6482/8210
Bit of a bump, and you forgot one of the coolest rarely-used features. Not sure exactly how, but JS can download and parse XML. Gmail uses it a lot.
score_under
Posts: 2/10
Javascript can:
  • automatically submit things ( form.submit() )
  • change images ( image.src="" )
  • preload images ( xxx=new Image(); xxx.src="" )
  • make sounds for events ( bgsound.src="" )
  • etc...
Narf
Posts: 77/100
W3schools, tutorials and samples you can edit online and emediately test out. Not only for Javascript but for a whole bunch of programming and markup languages.
HyperLamer
Posts: 6079/8210
Javascript is, as its name implies, a sort of 'Java Lite'. It does make a decent starting language, since it's simple but similar to C. Here's some sample code to get you started:

<script language="javascript">
function ShowAMessageBox(text)
{
alert(text.toUpper());
}
</script>

<button onclick="ShowAMessageBox('Greetings planet!')">Click Me</button>


When you click the button, the message "GREETINGS PLANET!" will appear. (I'd show you, but it's kind of impossible here. ) Some key points to notice here:
  • You can just use <script>, but proper HTML specifies the language as well. (Makes it easier to read, too.) It's a good habit to get into, lest your code look like the board's.
  • Unlike in C, you don't use types. All functions are 'function' and all variables are 'var'. Strings work a bit different, though. IIRC you do something like var x = new String();.
  • The onclick statement, as you might expect, executes code when something gets clicked. Note the 2 different types of quotes. If you tried to use " inside the statement, you would close the quote, so you need to use ' instead. If you need to put quotes in a string, you can use \", \' or in some cases &quot;.
  • If you don't want all caps, just do alert(text);, you don't need to have a .whatever() at the end.
  • You must have a semicolon at the end of a statement, and everything is case-sensitive. A pain, but you'll get used to it. Note that for, while, if and else statements don't have a semicolon before their contents, as it's considered all one statement (eg: if(something) doThis(); else doThat(); ).
neotransotaku
Posts: 3669/4016
uh...this should be able to answer many of your questions:
Javascripter FAQ
Javascript by Wiki

and uh...I think subway uses Javascript on their webpage
Snika
Posts: 256/916
Paraplayer told me to learn JavaScript or else my arse is fired from his gaming company...

So, this brings me to my list of questions.

Anyone know of any killer tutorials?
Where should I start?
Are there some kick-bottom editors out there?
What can JavaScript do?
Is it simliar to Flash's ActionScript and Mac's AppleScript?
Is it insanley hard?
Should I start with a smaller language and work my way up?
Does Subway use JavaScript?

Please, help me. I would like to learn a programming language and this whole JavaScript sounds as good as any.

=P Snika
Acmlm's Board - I2 Archive - Programming - JavaScript!


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.010 seconds.