• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to footer
  • Core Java
  • Design Patterns
  • JSP
  • Servlets
  • Building Tools
  • jQuery
  • Spring
  • Hibernate
  • Mongo DB
  • More
    • HTML
    • SCJP
    • AJAX
    • UML
    • Struts
    • J2EE
    • Testing
    • Angular JS

J2EE Reference

  • Home
  • About Us
    • Java Learning Centers
  • Contact Us

jQuery

December 3, 2012 By j2eereference Leave a Comment

What is jQuery

jQuery is a JavaScript Library which simplifies JavaScript programming, HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.

Your first jQuery code

Lets see an example which will popup an alert while loading the page using jQuery.

1
2
3
4
5
6
7
8
9
10
<html>
<script type="text/javascript" src="script/jquery-1.8.2.js"> </script>
<script  type="text/javascript">
window.jQuery("document").ready(function(){
alert("This is from j2eereference.com");
})
</script>
<body>
</body>
</html>

 

Here you can notice that we have included a java script file –  jquery-1.8.2.js , Which provides many features. You can download this js file from jQuery website.

 

jQuery provides a shortcut ‘$ ‘ for window.jQuery(“document”).ready , By which we can rewrite the code as below.

1
2
3
4
5
6
7
8
9
10
<html>
<script type="text/javascript" src="script/jquery-1.8.2.js"> </script>
<script  type="text/javascript">
$(function(){
alert("This is from j2eereference.com");
})
</script>
<body>
</body>
</html>

 

Filed Under: jQuery

Reader Interactions

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

FOLLOW US ONLINE

  • View J2eereference-166104970118637’s profile on Facebook
  • View j2eereference’s profile on Twitter
  • View j2eereference’s profile on LinkedIn

Subscribe by email

Recent posts

  • Java Buzzwords
  • Anonymous Inner Class in Java
  • Network Programming – java.net Package
  • Java Regular Expressions
  • Method Local Inner Class in Java
  • URL Processing in Java
  • Iterator Design Pattern Implementation using Java
  • Strategy Design Pattern Implementation using Java
  • Decorator Design Pattern
  • Adapter Design Pattern Implementation using Java
  • JSF Composite Components
  • JSF UI Components
  • What is JavaServer Faces (JSF)?
  • GOF Design Patterns
  • History and Need for Design Patterns

Footer

Core Java
Design Patterns
JSP
Servlets
HTML
Building Tools
AJAX
SCJP
jQuery
Testing
Spring
UML
Struts
Java Centers
Java Training
Home
About Us
Contact Us
Copyright © j2eereference.com. All right reserved.