I am going to send a mail series talking about web programming with
javascript and also perl CGI in the backend.
I will also give some live samples for you to play and learn.
You should do a view source of the page to learn the code. And the
server CGI code cannot be seen, so I will send
it separately.
Let us get started first.
Before we go very far let us start with some babysteps in javascript
and jQuery programming.
You can either download jquery.js and use it for your code or you can
fetch the jquery toolkit when the page is
loading using a HTTP URL.
I prefer to download it and use it.
The structure of the basic web page, this has to be a html file on a
web server or even a file:/// URL.
You need a web server when using Ajax , CGI and server side processing.
So let us say you have a file called first.html.
This is the structure.
-start-
<html>
<head>
<title> First jQuery page </title>
<link rel="stylesheet" href="/css/stylesheet.css" type="text/css" />
<script type="text/javascript" src="/jquery/jquery.js" ></script>
<script type="text/javascript">
$(function() {
alert("hello I am jQuery");
})
</script>
</head>
<body>
<h1> This is just a jQuery test </h1>
</body>
-end-
Just try this code.
We are using external files /jquery/jquery.js and /css/stylesheets.css.
These two files need to be present.
I will talk about cascading stylesheets later. But I wish to introduce it today.
The paths have to correspond to the file system paths.
If you run this code you should get the output as a very annoying alert.
If that works then you have started yourself as a web programmer.
We will slowly build on top of this. If you do this today(and not just
read the mail), then
you will be able to do some cool animations, some effects and some
mouse events or keyboard
events can be harnessed.
But unless you learn through trial and error you will never learn.
Just reading the mail will not give you anything.
-Girish
--
Gayatri Hitech
http://gayatri-hitech.com
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
ILUGC Mailing List Guidelines:
http://ilugc.in/mailinglist-guidelines