Parlez-vous "Javascript"

Parlez-vous "Javascript"

Postby omoi » Thu May 31, 2007 2:43 pm

Hello out there, would-be/already-are web coders :) This is going to be the beginning of what could a wonderful tutorial on javascript. I am going to try to start out light. Here goes.

So you saw someone using a few effects on their page and you thought it was cool, huh? Well, that might have been javascript (nowadays, that might be AJAX) that you saw. So now you know, but how do you make those pretty, shiny effects work for you?

Maybe I can tell you a little.

As far as the background goes, javascript is an object oriented language for web coding that revolves around the Document Object Model (commonly referred to as the DOM). For a better explanation than I could explain, check out w3schools' intro to Javascript.

Heck, you may even want to read their whole tutorial, but I am going to write this one anyway.

When you want to write javascript, you can write it either internally or externally. Since most Javascript that is seen for the average website is internal, I am going to approach things from that angle. Internal javascript can be in the <head> tag or the <body> tag. Most of the time it lives in the head tag if you have parts of your javascript that need to run before the page loads. However, you can also put it in the <body> tag if you don't care whether the javascript runs before the page load or after.

Where does Javascript live? Well, it's mansion can be found within the rolling hills of the <script> tag like this:

Code: Select all
.
.
.
<head>
<script ...>
your javascript stuff
</script>
</head>
.
.
.


Since Javascript isn't the only kind of script there is, you have to tell your script tag "I'm writing Javascript!" In order to do that, you can write like this:

Code: Select all
.
.
.
<script language="text/javascript">
.
.
.


It will run just fine. Now, if you are wanting to validate your page using w3c or a similar site, you may run into a few snafu's if you use the format I just gave you because XHTML Strict 1.x standard web pages see that <script> tag as malformed. Because of this, if you are using the XHTML Strict standard, then please use the following:

Code: Select all
.
.
.
<script type="javascript">
.
.
.


Alternately, I think you could use "type='text/javascript'" and still be okay.

Now while I would to tell you all about the wonderful things you can do with this now, it will be better if I make you wait until the next installation where I talk to you about objects and methods, so until next time.
Last edited by omoi on Thu Jan 01, 2009 12:23 pm, edited 1 time in total.
Image

Read the rules.
Check this topic and make your suggestions known!
This is how we make suggestions.
User avatar
omoi

Moderator Team
 
Posts: 1038
Joined: Wed May 23, 2007 8:31 pm
Location: Georgia


Re: Parlez-vous "Javascript"

Postby super3boy » Thu May 31, 2007 3:40 pm

Great I look forward to this. I have to learn some javascript and ajax to continute my web goals. I also have to figure out how to work an api in a web scripting language.
Image
Image
Image
Image
User avatar
super3boy

Site Admin
 
Posts: 4620
Joined: Sun May 20, 2007 3:57 pm
Location: Atlanta, GA


Re: Parlez-vous "Javascript"

Postby Brent » Fri Jun 15, 2007 5:27 am

super3boy wrote:Great I look forward to this. I have to learn some javascript and ajax to continute my web goals. I also have to figure out how to work an api in a web scripting language.

For the API goal, learn ASP.NET.
Image
User avatar
Brent

Premium Member
 
Posts: 1821
Joined: Wed May 23, 2007 8:38 pm
Location: AZ, USA


Re: Parlez-vous "Javascript"

Postby super3boy » Fri Jun 15, 2007 1:49 pm

I will take your advice. What program do I need to code that in? One of the express editions? I will also have to find a host. Could you host my scripts? (My package does not support asp)
Image
Image
Image
Image
User avatar
super3boy

Site Admin
 
Posts: 4620
Joined: Sun May 20, 2007 3:57 pm
Location: Atlanta, GA


Re: Parlez-vous "Javascript"

Postby Brent » Fri Jun 15, 2007 2:29 pm

super3boy wrote:I will take your advice. What program do I need to code that in? One of the express editions? I will also have to find a host. Could you host my scripts? (My package does not support asp)
Neither does mine. I can host your scripts on my desktop. It just can't be port 80. Seeing how my ISP blocks port 80. :cuss:
Image
User avatar
Brent

Premium Member
 
Posts: 1821
Joined: Wed May 23, 2007 8:38 pm
Location: AZ, USA


Re: Parlez-vous "Javascript"

Postby super3boy » Fri Jun 15, 2007 2:32 pm

:cuss: ISPs.
Image
Image
Image
Image
User avatar
super3boy

Site Admin
 
Posts: 4620
Joined: Sun May 20, 2007 3:57 pm
Location: Atlanta, GA


localhost?

Postby omoi » Fri Jun 15, 2007 7:05 pm

you could also host them on your own machine, super3.
Image

Read the rules.
Check this topic and make your suggestions known!
This is how we make suggestions.
User avatar
omoi

Moderator Team
 
Posts: 1038
Joined: Wed May 23, 2007 8:31 pm
Location: Georgia


Re: Parlez-vous "Javascript"

Postby super3boy » Fri Jun 15, 2007 9:32 pm

But my :cuss: does not let me do outgoings stuff.
Image
Image
Image
Image
User avatar
super3boy

Site Admin
 
Posts: 4620
Joined: Sun May 20, 2007 3:57 pm
Location: Atlanta, GA


Re: Parlez-vous "Javascript"

Postby Roswell » Thu Jul 05, 2007 5:17 pm

@omoi: Actually, "text/javascript" is correct, "javascript" is incorrect.
@cg, super3: You do not have to use ASP for an API. Many API's (Flickr's, for instance), as well as a few others that I know of are coded using PHP.
Roswell

Moderator Team
 
Posts: 2600
Joined: Thu Jul 05, 2007 5:06 pm


Re: Parlez-vous "Javascript"

Postby omoi » Thu Jul 05, 2007 5:47 pm

Roswell wrote:@omoi: Actually, "text/javascript" is correct, "javascript" is incorrect.
@cg, super3: You do not have to use ASP for an API. Many API's (Flickr's, for instance), as well as a few others that I know of are coded using PHP.


I figured that out a little later. I really should edit that. Thanks for the reminder.
Image

Read the rules.
Check this topic and make your suggestions known!
This is how we make suggestions.
User avatar
omoi

Moderator Team
 
Posts: 1038
Joined: Wed May 23, 2007 8:31 pm
Location: Georgia


Next

Return to Javascript

Who is online

Users browsing this forum: No registered users and 0 guests