WebArtz - The Web Design Forum
Welcome to WebArtz, Guest!

WebArtz is a nice place for discussions related to web designing and coding. We help our members to code their own website templates with HTML and CSS. We give them advice on various issues.

To know more about WebArtz Forum, visit the About Us page.

At the moment, you are viewing the forum as a guest. As a guest you can't make post and participate in discussions. You need to register and become a member of the forum. Click the register link below and become a part of this forum.

Thank You

WebArtz - The Web Design Forum
Welcome to WebArtz, Guest!

WebArtz is a nice place for discussions related to web designing and coding. We help our members to code their own website templates with HTML and CSS. We give them advice on various issues.

To know more about WebArtz Forum, visit the About Us page.

At the moment, you are viewing the forum as a guest. As a guest you can't make post and participate in discussions. You need to register and become a member of the forum. Click the register link below and become a part of this forum.

Thank You


You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1Accespted Learning jQuery [Part 1] Sat Jul 03, 2010 2:29 am

RockerMan

RockerMan
Technician
Technician
Learning jQuery [Part 1]
Start learning jQuery here


Learning jQyery
This tutorial was suggested/requested by Ankillien

OK so there is alot of people wanting to learn jQuery, so I am here to help you with that. Durning the course of this series I will be learning you the basics of jQuery and a few simple effects.

So what is jQuery?
jQuery is a lightweight cross-browser JavaScript library that emphasizes interaction between JavaScript and HTML, it is a fast and concise JavaScript library which simplifies the creation of animations, communications to server requests, document transversing and event handling. So basicly it is a development tool which allows for easier, faster JavaScript development.

Where can I use it?
You can use jQuery anywhere, the script is placed in a script tag and thats it.

OK so lets get started!

To start, we need a copy of the jQuery library, which you can download at the bottom of this tutorial via the download button. Right Click >> Save Link As >> Save it to your desktop.
Once you have done this drag the file into your favorite editor inside the <head> tags. you have now succesfully added the whole jQuery library. You need to do this unless the effects won't work.

We are now going to do a quick effect, you have proberly seen it on all beginners tutorials for jQuery, it's the Hello World Very Happy

OK so we start with the HTML:
Code:
<html>                                                                 
 <head>                                                                 
 <script type="text/javascript" src="jquery.js"></script>         
 <script type="text/javascript">                                       
  <!--we will add our javascript code here-->                                   
 </script>                                                             
 </head>                                                               
 <body>                                                                 
  <!-- we will add our HTML content here -->                                       
 </body>                                                               
 </html>

This page loads the jQuery library you have just added (If you are not using FTP be sure to change the jquery.js to the link of where you have hosted it | If you are using FTP make sure the URL points to where you stored your copy of jquery! This example assumes that you store it in the same directory as the HTML). Two comments indicate where we will expand this template with code.

As almost everything we do when using jQuery reads or manipulates the document object model (DOM), we need to make sure that we start adding events etc. as soon as the DOM is ready.
To do this, we register a ready event for the document.

Code:
$(document).ready(function() {
  // do stuff when DOM is ready
 });

OK so lets investigate this code Razz

Spoiler:


Putting an alert into that function does not make much sense, as an alert does not require the DOM to be loaded. So lets try something a little more sophisticated: Show an alert when clicking a link.

Add this to your body:
Code:
<a href="">Link</a>

Now upgrade the jQuery to this:
Code:
 $(document).ready(function() {
  $("a").click(function() {
    alert("Hello world!");
  });
 });

This should show the alert as soon as you click on the link. Then, open the html page in the browser and click any link. You should see a pop-up window with "Hello world!" message regardless of what link was clicked.

Thanks for your time and hope to see you read the rest of the series to come.
RockerMan

Notice : This tutorial is copyrighted by WebArtz Forum. You may not publish it on anywhere without written permission from the administrators.

http://www.graphics-post.com/

2Accespted Re: Learning jQuery [Part 1] Sat Jul 03, 2010 4:45 pm

ankillien

ankillien
Administrator
Administrator
This is Great, Mike! Very Happy
Surely gonna be accepted and listed under a special category Smile

3Accespted Re: Learning jQuery [Part 1] Sat Jul 03, 2010 6:09 pm

RockerMan

RockerMan
Technician
Technician
Lol, thank you Smile

http://www.graphics-post.com/

4Accespted Re: Learning jQuery [Part 1] Sun Jul 04, 2010 12:39 pm

ankillien

ankillien
Administrator
Administrator
Thanks for the contribution Very Happy

Tutorial Accepted

5Accespted Re: Learning jQuery [Part 1] Mon Jul 05, 2010 4:07 pm

Guest


Guest
Wow thank you i really wanted that one!!!!!!!!!! Very Happy

6Accespted Re: Learning jQuery [Part 1] Mon Jul 05, 2010 4:10 pm

RockerMan

RockerMan
Technician
Technician
Your welcome Smile

http://www.graphics-post.com/

7Accespted Re: Learning jQuery [Part 1] Tue Jul 06, 2010 2:55 am

Fred100

Fred100
Registered Member
Registered Member
Sweet , Love it mate Wink
Awesome work , Went through all what you wrote and Loved it , brilliant work.

http://www.art-castle.biz/forum.htm

8Accespted Re: Learning jQuery [Part 1] Tue Jul 06, 2010 3:50 am

RockerMan

RockerMan
Technician
Technician
Thanks Wink

http://www.graphics-post.com/

9Accespted Re: Learning jQuery [Part 1] Thu Aug 26, 2010 7:08 pm

Pinks


Registered Member
Registered Member
thanx but where is the download button?

10Accespted Re: Learning jQuery [Part 1] Thu Aug 26, 2010 7:51 pm

ankillien

ankillien
Administrator
Administrator
I think he forgot to put it Razz
You can find it here : http://jquery.com

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum