J query intro_29thsep_alok
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,013
On Slideshare
961
From Embeds
52
Number of Embeds
1

Actions

Shares
Downloads
27
Comments
0
Likes
0

Embeds 52

http://www.spritle.com 52

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. jQuery Introduction - by Alok Swain http://www.Spritle.com Copyright: Spritle Software Private Limited Please note that some of the images or content might have been taken from Internet and we don’t own copyright on them. If you have any objection in the content, please let us know at info@spritle.com
  • 2. About Me http://www.Spritle.com Copyright: Spritle Software Private Limited
  • 3. Why jQuery ?
    • Makes Javascript coding easier.
    • Increases the speed of development.
    • Extensive support through community forums and large plugin base for numerous features.
    • Example:
    • document.getElementbyId(‘myElement’); $(‘#myElement’)
  • 4. Main objectives of jQuery
    • Improving interactions between JavaScript and HTML.
    • Highly effective, readable and short code.
    • Almost everything converts to find a certain element and do something on it.
    http://www.Spritle.com Copyright: Spritle Software Private Limited
  • 5. jQuery Selectors
    • Basic CSS selectors. Example- .myClass, #tableID, a.myLink...
    • Position based selectors: a:first, p:last...
    • a:hidden
    • Showcase example
  • 6. Selectors continued...
    • Multiple elements can also be selected to perform a common function on them.
    • e.g. - $(“div#myDiv, #someID”)
  • 7. DOM Traversal
    • $(“div.myDiv”).parent();- returns the immediate parent.
    • $(“div.myDiv”).next(); - returns the next sibling.
    • $(“h1:first”).parents(); - returns all parents upto the html tag.
  • 8. DOM Modification.
    • $(“div#myDiv”).html(“Some Text.”);
    • $(“table#myTable).append(“<tr> </tr>”);
    • Showcase example
  • 9. Chaining method calls.
    • Most jQuery methods return another jQuery object representing the same collection.
    • Thus on the output of one method other methods calls can be chained. This is one of the powerful features of jQuery.
    • Some methods return a different collection.
    • In such cases .end() method can be used to revert to the previous collection.
    • Showcase example: $('div.section').hide().addClass('gone');
  • 10. Events
    • Events can be fired when an element is clicked, hovered upon, dragged.
    • Default events associated with certain elements can also be changed.
    • Showcase example
  • 11. Animations
    • $(“#myDiv”).show(‘slow/fast’);
    • Showcase Example
  • 12. Ajax
    • $.get();
    • $.post();
    • $.ajax({
    • type: ‘get’,
    • url: '/ajax/method/?parameter=' + param,
    • dataType: 'script'
    • });
    • Showcase Example
  • 13. Plugins
    • Extensive Plugin support for many commonly desired functionalities.
    • Defining custom plugins is also possible with very little effort.
    • Plugin examples: 1. Tablesorter
    • 2. Facebox
  • 14. Extending jQuery
    • jQuery is extensible through plugins, which
    • can add new methods to the jQuery object.
    • UI – Widgets.
    • Showcase example .
  • 15. Disadvantages.
    • Compared to other JavaScript libraries jQuery has fewer utility functions.
    • This issue is countered by using other libraries like Underscore.js which includes many utility functions that Prototype has.
  • 16.
    • Thank you & Questions
    http://www.Spritle.com Copyright: Spritle Software Private Limited