GIDForums  

Go Back   GIDForums > Webmaster Forums > Web Design Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 23-Oct-2004, 22:36
JasonMichael's Avatar
JasonMichael JasonMichael is offline
Awaiting Email Confirmation
 
Join Date: Jul 2004
Posts: 135
JasonMichael has a spectacular aura about
Post

An Introduction to Javascript


For those of you who are interested in learning Javascript, I have decided to write some short tutorials here at GIDForums. I have written a few Javascript applications, over the past couple years, and have learned that Javascript is not much harder to learn than PHP. There was a day, not long ago, when Javascript was as much a mystery to me as PHP. One thing I could not understand was how Javascript ran - was it run from the server or from the browser? Later, I came to understand that Javascript is a language that runs on the browser of the user visiting the web page. I have also read that Javascript may run on the server-side, in order to do server-side operations, but its use is very limited and almost non-existent, and only Microsoft is continuing to develop their own version of Javascript called, Jscript, to run on servers.

Since Javascript is typically for use on browsers, one may ask, "Is Javascript compatible with all browsers?". Generally, it is, but just as web designers using CSS have problems with browser compatibility issues, the same applies to programmers using Javascript. In fact, not only are their compatibility issues among the browsers, but also versions of each browser, such as between IE 5+ and 6+. For this reason, many web programmers may have dabbled with Javascript a bit, to get some additional functionality on their websites, only to end up taking the Javascript code off, because it only worked with MS Internet Explorer 6.0, and 10-20% of the visitors used other types of browsers (i.e. Mozilla or Firefox). With some tinkering and research, most Javascript functions can be modified to work with a majority of the browsers available.

The following is an example of how Javascript code looks, as I have written an example function within some HTML script tags:
Code:
<script language="JavaScript" type="text/javascript"> <!-- function sayHello () { // reserve in memory the variable 'string' var string; //set the string string = "Hello there.... World!"; document.write(string); } //--> </script>

In order to use this function, it should be placed in the header of your HTML page. Using an HTML button and its OnClick action, the following code demonstrates how to call our Javascript function:

HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Javascript Wizardry</title> <script language="JavaScript" type="text/javascript"> <!-- function sayHello () { // reserve in memory the variable 'string' var string; //set the string string = "Hello there.... World!"; document.write(string); } //--> </script> </head> <body> <input type="button" onclick="javascript:sayHello();return true;"> </body> </html>

This initial post is meant only to spark some interest in Javascript. I intend to provide some additional examples of using Javascript to create some dazzling web effects, such as a pop-up calendar, and auto-filling form fields. As I continue with this tutorials, I am sure that others will contribute with their comments and Javascript code or experiences and we will all benefit from sharing each others knowledge on this language.
  #2  
Old 24-Oct-2004, 00:01
crystalattice's Avatar
crystalattice crystalattice is offline
Flame War Instigator
 
Join Date: Apr 2004
Location: San Diego
Posts: 1,543
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice
Always love to read tutorials, especially as I'm getting back into web design (haven't made a page in 5 years).

HTML Goodies also has a Javascript primer, plus other web design info.
__________________
Common Sense v2.0-Striving to make the world a little bit smarter.
  #3  
Old 24-Oct-2004, 10:19
JasonMichael's Avatar
JasonMichael JasonMichael is offline
Awaiting Email Confirmation
 
Join Date: Jul 2004
Posts: 135
JasonMichael has a spectacular aura about
Cool

CrystalLattice,

Great to see you here! Before this year, I hadn't done a web page of my own in several years. In one of my next posts, I will be posting some Javascript resources, as there are a multitude of them that are very helpful. Eventually, GIDForums will be a resource in itself, as more Javascript is posted here, and a seperate forum is dedicated to it.
 
 

Recent GIDBlogHalfway done! by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
We're looking for JavaScript codes / mini tutorials. JdS Web Design Forum 7 31-Mar-2008 23:25
javascript menu dopee Web Design Forum 7 30-Jul-2004 23:22
JavaScript Tutorial Part 1 pcxgamer Web Design Forum 2 01-Dec-2003 09:16
This JavaScript doesn't work on Mozilla. JdS Web Design Forum 8 02-Jul-2003 14:08
Why does javascript cause sound problem to website rhino1616 Web Design Forum 8 06-May-2003 16:25

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 22:52.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.