Header AD

How jQuery works with your Web page

jQuery gives Web developers Because jQuery is so easy to implement.Facebook and Twitter, for example.An easy way to create sophisticated
effects with almost no coding.jQuery lets you easily change the appearance, location, or behavior of an
element on a Web page.

1.<!doctype...>: This long element tellsthe Web browser which version of HTML isused in the code that follows. You shouldalways include it at the beginning of any

HTML pages you create.

2.<html>: This element begins the HTMLpage.

3.<head>: This element designates thebeginning of the head section. This sectionusually contains the title and any script element.

4.<title>My Test Page</title>:This line displays the title of the page.

5.<script src=”js/jquery-1.4.

min.js”></script>:
This line provides the location of the jQuery library.
6.<script type=”text/java

script”>
: This script tag tells the browser that everything inside is JavaScript code.
7.$(document).ready(function(){:The dollar sign is an alias for the jQuery function. The ready function waits for the Web page to load, and then the code contained inside it is executed.
8.a l e r t ( j Q u e r y ( ‘ i m g ’ ) .attr(‘height’));: The alert function opens a pop-up alert box. The dollar sign that follows is calling the jQuery attr function. This function returns the value of whatever attribute is in quotes, in this case, the height. Notice that img precedes the attr function. In short, this function means, “look for all img elements you find in the HTML code, and return the value of the height attribute of the first one.”
9.});: This punctuation is closing the braceand parenthesis started in the $(document).ready(function(){ line
10.</script>: This tag closes the <script> tag and ends the JavaScript code block
11.</head>: This tag closes the head section of the HTML.
12.<body>: This tag begins the body section, where the main content consisting of HTML code, text, and images is written.
13.<p>This is my test page.<p>: This line is a line of text that appears in the page.
14.<img src= “images/home. gif” height=”28” width=”28” alt=”This is a test image.”>:This img element displays on the Web page an image with several attributes.
15.</body>: This tag ends the content section of the page.
16.</html>: This tag ends the HTML page.



How jQuery works with your Web page How jQuery works with your Web page Reviewed by Unknown on 11:46 AM Rating: 5

No comments

Post AD