 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 |
|