OnlineSolution Forum IndexOnlineSolution Forum Index
OnlineSolution
FAQ  FAQ   Search  Search   Memberlist  Memberlist   Usergroups  Usergroups   Register  Register  
Register::  Log in Log in to check your private messages


 Advertisement

Post new topic  Reply to topic
 [ JavaScript / AJAX ] jQuery Tutorial 1 - Let's get started « View previous topic :: View next topic » 
Author Message
Paul
PostPosted: Tue Jan 26, 2010 11:47 pm    Post subject: jQuery Tutorial 1 - Let's get started Reply with quote

Site Admin

Joined: 10 Dec 2007
Posts: 143
Location: New Zealand

jQuery is a lightweight but powerful Javascript Library which is widely used for many of popular websites.

A JavaScript Library is a set of classes/functions that helps developers to build codes fast and ease, lets you do develop faster and more efficiently.

Firstly, you'll need to download jQuery from http://docs.jquery.com/Downloading_jQuery.

jQuery comes with either minified version or uncompressed (full) version, minified version recommended for live web server, and uncompressed version into your developement environment due to minified version is smaller in size but its impossible to track what is going on with your jQuery library.

Installation will be extremely easy, because you'll only need to download js file and upload it your server/pc.

Steps will be:


As you upload js file, then you will need to create a dummy HTML file and link js file to your HTML page. Your test HTML file should look something like below:

Code:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>

<body>
</body>

</html>


Its time to code our first HTML file using jQuery:

Code:
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("div").click(function(){
    alert("Hello World");
  });
});
</script>
<body>
<div>Click Me</div>
</body>

</html>


Where $(document).ready(function(){}); is to tell client's brower to start function when document is loaded;

$("div").click(function(){ alert("Hello World"); } tells when <div> is clicked, prompt message box saying "Hi World".



------------------------------------------------------------------------------------

jQuery Tutorials

- Tutorial 1 : Tutorial 1 : Let's get started
- Tutorial 2 : Tutorial 2 : Show/Hide, Fade In/Fade Out Contents

------------------------------------------------------------------------------------
_________________
Paul KH Kim

http://www.onlinesolution.co.nz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

 Sponsor Link

Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



OnlineSolution - Since 2007
DAJ Glass (1.0.8) template by Dustin Baccetti
EQ graphic based off of a design from www.freeclipart.nu
Powered by phpBB © 2001, 2005 phpBB Group