SlideShare a Scribd company logo
jQuery
ajax & plugins




Inbal Geffen
ajax before jQuery
      function getXMLHttp()
      {      var xmlHttp;
             if (window.XMLHttpRequest) { // Mozilla, Safari, ...
                       var xmlHttp = new XMLHttpRequest();
                 }
             else if (window.ActiveXObject) { // IE
                      var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
               }
                 return xmlHttp;
      }

      function MakeRequest()
      {        var xmlHttp = getXMLHttp();
               xmlHttp.onreadystatechange = function()
               {
                 if(xmlHttp.readyState == 4)
                 {
                         HandleResponse(xmlHttp.responseText);
                 }
               }
               xmlHttp.open("GET", "ajax.php", true);
               xmlHttp.send();
             }

      function HandleResponse(response) { document.getElementById('ResponseDiv').innerHTML = response;}



Inbal Geffen
ajax using jQuery - $.post

          function MakeRequest() {
           var url = "ajax.php";
           $.post(url, ' ' ,function(data) {
             $("#ResponseDiv").html(data).show();
           });
      }




Inbal Geffen
ajax using jQuery - $.get

          function MakeRequest() {
           var url = "ajax.php";
           $.get(url, ' ' ,function(data) {
             $("#ResponseDiv").html(data).show();
           });
      }




Inbal Geffen
ajax using jQuery - $.ajax

       function MakeRequest() {
      $.ajax({
      type: "GET",
      url: "ajax.php",
      success: function (result) {
           $("#ResponseDiv").html(result);
      },
      error: function (error) {
      alert(error);
      }
      });
      }

Inbal Geffen
jQuery plugins
       ●       Many plugins exist in the web

       ●       http://archive.plugins.jquery.com - main jQuery plugins archive

       ●       Plugins usually include instructions and example code for how to use them

       ●       http://www.simplefadeslideshow.com/

       ●       http://tympanus.net/codrops/2012/09/03/bookblock-a-content-flip-plugin/

       ●       http://plugins.in1.com/socialist/demo

       ●       http://nbartlomiej.github.com/foggy/

       ●       http://tsvensen.github.com/equalize.js/

Inbal Geffen
jQuery plugins
      <!--Add the jQuery.js and the plugin.js-->

      <head>
      <title>Example</title>
      <script src="jquery.js" type="text/javascript"></script>
      <script src="jquery.plugin.js" type="text/javascript"></script>
      </head>

      <!--Carousel example Add the jQuery.js and the plugin.js-->

      <script src="js/jquery-1.7.min.js" type="text/javascript" charset="utf-8"></script>
      <script src="js/jquery.featureCarousel.min.js" type="text/javascript" charset="utf-8"
      ></script>




Inbal Geffen
jQuery plugins
      <!--For each image we want to add to the carousel we need to add this kind of div-->

      <div class="carousel-feature">
           <img class="carousel-image" src="images/flowers1.jpg" alt="Image1" />
           <div class="carousel-caption">
                <p>Amazing flower</p>
           </div>
      </div>




Inbal Geffen
jQuery plugins
      <!--All divs need to be nested under div with id="carousel" -->

      <body>
      <div id="carousel-container">
           <div id="carousel">
                <div class="carousel-feature">
                      <img class="carousel-image" src="images/flowers1.jpg" alt="Image1" />
                      <div class="carousel-caption">
                           <p>Amazing flower</p>
                      </div>
                </div>
                <div class="carousel-feature">
                .....
           </div>
      </div>
      </body>
Inbal Geffen

More Related Content

PPTX
AngularJS - $http & $resource Services
PPTX
AngularJS $http Interceptors (Explanation and Examples)
PDF
Introduction to AngularJS For WordPress Developers
PPTX
AngularJS Services
PPTX
AngularJS Routing
PPTX
AngularJS Compile Process
PDF
Short intro to JQuery and Modernizr
PPTX
AngularJS - $http & $resource Services
AngularJS $http Interceptors (Explanation and Examples)
Introduction to AngularJS For WordPress Developers
AngularJS Services
AngularJS Routing
AngularJS Compile Process
Short intro to JQuery and Modernizr

What's hot (20)

PDF
Introducing jQuery
KEY
Sprout core and performance
PPTX
Dart and AngularDart
PPTX
AngulrJS Overview
PDF
Aplicacoes dinamicas Rails com Backbone
PDF
jQuery and Rails, Sitting in a Tree
PPTX
Angular 1.x vs. Angular 2.x
KEY
PHPConf-TW 2012 # Twig
PPTX
jQuery Best Practice
PDF
Ruby - Design patterns tdc2011
PDF
Utilization of zend an ultimate alternate for intense data processing
PDF
WordPress Kitchen 2014 - Александр Стриха: Кеширование в WordPress
PDF
JQuery In Drupal
PDF
Jquery plugin development
PDF
Intro to jquery
PDF
JQuery plugin development fundamentals
ODP
Jquery Plugin
PDF
Using JavaScript in Drupal
PDF
JAVASCRIPT NÃO-OBSTRUTIVO com jQuery
PDF
Prototype & jQuery
Introducing jQuery
Sprout core and performance
Dart and AngularDart
AngulrJS Overview
Aplicacoes dinamicas Rails com Backbone
jQuery and Rails, Sitting in a Tree
Angular 1.x vs. Angular 2.x
PHPConf-TW 2012 # Twig
jQuery Best Practice
Ruby - Design patterns tdc2011
Utilization of zend an ultimate alternate for intense data processing
WordPress Kitchen 2014 - Александр Стриха: Кеширование в WordPress
JQuery In Drupal
Jquery plugin development
Intro to jquery
JQuery plugin development fundamentals
Jquery Plugin
Using JavaScript in Drupal
JAVASCRIPT NÃO-OBSTRUTIVO com jQuery
Prototype & jQuery
Ad

Viewers also liked (7)

PDF
Jquery mobile2
PDF
J querypractice
PDF
jQuery mobile UX
PDF
J queryui
PDF
Jqeury ajax plugins
PDF
Jquery2
PDF
Web Storage & Web Workers
Jquery mobile2
J querypractice
jQuery mobile UX
J queryui
Jqeury ajax plugins
Jquery2
Web Storage & Web Workers
Ad

Similar to Jqeury ajax plugins (20)

PDF
Building iPhone Web Apps using "classic" Domino
PDF
Clean Javascript
PPTX
PDF
Rich Portlet Development in uPortal
PDF
jQuery Internals + Cool Stuff
PDF
jQuery: Events, Animation, Ajax
PDF
Drupal & javascript
PDF
Rails is not just Ruby
PDF
Avinash Kundaliya: Javascript and WordPress
PDF
jQuery and Rails: Best Friends Forever
PDF
Javascript Frameworks for Joomla
PDF
Frontin like-a-backer
TXT
Private slideshow
PDF
Introduction to backbone presentation
PDF
Yearning jQuery
PDF
Hooks WCSD12
PDF
AnkaraJUG Kasım 2012 - PrimeFaces
KEY
Jarv.us Showcase — SenchaCon 2011
PDF
Understanding backbonejs
PDF
After max+phonegap
Building iPhone Web Apps using "classic" Domino
Clean Javascript
Rich Portlet Development in uPortal
jQuery Internals + Cool Stuff
jQuery: Events, Animation, Ajax
Drupal & javascript
Rails is not just Ruby
Avinash Kundaliya: Javascript and WordPress
jQuery and Rails: Best Friends Forever
Javascript Frameworks for Joomla
Frontin like-a-backer
Private slideshow
Introduction to backbone presentation
Yearning jQuery
Hooks WCSD12
AnkaraJUG Kasım 2012 - PrimeFaces
Jarv.us Showcase — SenchaCon 2011
Understanding backbonejs
After max+phonegap

Jqeury ajax plugins

  • 2. ajax before jQuery function getXMLHttp() { var xmlHttp; if (window.XMLHttpRequest) { // Mozilla, Safari, ... var xmlHttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } return xmlHttp; } function MakeRequest() { var xmlHttp = getXMLHttp(); xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4) { HandleResponse(xmlHttp.responseText); } } xmlHttp.open("GET", "ajax.php", true); xmlHttp.send(); } function HandleResponse(response) { document.getElementById('ResponseDiv').innerHTML = response;} Inbal Geffen
  • 3. ajax using jQuery - $.post function MakeRequest() { var url = "ajax.php"; $.post(url, ' ' ,function(data) { $("#ResponseDiv").html(data).show(); }); } Inbal Geffen
  • 4. ajax using jQuery - $.get function MakeRequest() { var url = "ajax.php"; $.get(url, ' ' ,function(data) { $("#ResponseDiv").html(data).show(); }); } Inbal Geffen
  • 5. ajax using jQuery - $.ajax function MakeRequest() { $.ajax({ type: "GET", url: "ajax.php", success: function (result) { $("#ResponseDiv").html(result); }, error: function (error) { alert(error); } }); } Inbal Geffen
  • 6. jQuery plugins ● Many plugins exist in the web ● http://archive.plugins.jquery.com - main jQuery plugins archive ● Plugins usually include instructions and example code for how to use them ● http://www.simplefadeslideshow.com/ ● http://tympanus.net/codrops/2012/09/03/bookblock-a-content-flip-plugin/ ● http://plugins.in1.com/socialist/demo ● http://nbartlomiej.github.com/foggy/ ● http://tsvensen.github.com/equalize.js/ Inbal Geffen
  • 7. jQuery plugins <!--Add the jQuery.js and the plugin.js--> <head> <title>Example</title> <script src="jquery.js" type="text/javascript"></script> <script src="jquery.plugin.js" type="text/javascript"></script> </head> <!--Carousel example Add the jQuery.js and the plugin.js--> <script src="js/jquery-1.7.min.js" type="text/javascript" charset="utf-8"></script> <script src="js/jquery.featureCarousel.min.js" type="text/javascript" charset="utf-8" ></script> Inbal Geffen
  • 8. jQuery plugins <!--For each image we want to add to the carousel we need to add this kind of div--> <div class="carousel-feature"> <img class="carousel-image" src="images/flowers1.jpg" alt="Image1" /> <div class="carousel-caption"> <p>Amazing flower</p> </div> </div> Inbal Geffen
  • 9. jQuery plugins <!--All divs need to be nested under div with id="carousel" --> <body> <div id="carousel-container"> <div id="carousel"> <div class="carousel-feature"> <img class="carousel-image" src="images/flowers1.jpg" alt="Image1" /> <div class="carousel-caption"> <p>Amazing flower</p> </div> </div> <div class="carousel-feature"> ..... </div> </div> </body> Inbal Geffen