SlideShare a Scribd company logo
Ing. Alejandro Lizardo Celiz
jQuery: facilitando la
construcción de sitios 2.0

       Ing. Alejandro Lizardo Celiz
jQuery: facilitando la
construcción de sitios 2.0

       Ing. Alejandro Lizardo Celiz
Carlitos Tévez




  Very emotional !
¿Que es jQuery?
 Es un framework javascript
¿Que es jQuery?
        Es un framework javascript


Existen otros como :
 • Prototype
 • YUI
 • Dojo
 • mooTools
¿Por qué jQuery?

- La curva de aprendizaje es mínima.
- La cantidad de plugins es enorme.
- En general se lleva bien con cualquier otra librería
- Tiene una comunidad muy accesible
Crecimiento




Según BuiltWith, una empresa dedicada a la generación de estadísticas relacionadas con
tecnologías web, jQuerry está siendo usado actualmente por el 31% de los top 10000
websites, y por casi el 40% de todos los sitios que examinan
¿Que necesito saber
     para usar jQuery?

- Conocimiento básico de javascript


- Noción de Document Object Model (DOM)
¿Que es el DOM?
Javascript vs jQuery
links = document. getElementByTagName(‘a’);

for (i=0; i < links.length; i++){
  links[i].style.display = ‘none’
}
Javascript vs jQuery
links = document. getElementByTagName(‘a’);

for (i=0; i < links.length; i++){
  links[i].style.display = ‘none’
}


$(‘a’).hide()
¿Cómo usar jQuery?
¿Cómo usar jQuery?
<script type=”text/javascript” src=”jquery.js”> </script>
<script type=”text/javascript” src=”miCodigo.js”> </script>


$(document).ready(function(){
     código...
})
Filosofía de jQuery

1. Encontrar algo en el HTML


2. Hacer algo con él
Selectores
1. $(‘#mi_ID’)        $(‘.mi_Clase’)   $(‘div’)
2. $(‘li:first’)

3. $(‘a[target=_blank’)
4. $(‘div:visible’)
5. $(‘a:eq(0)’)
6. $(‘div’, ‘#mi_ID’, ‘.mi_Clase’)
Métodos
$('div').addClass('color').fadeIn();


Insertando elementos
append(), appendTo(), before(), after()

Atributos
css(), attr(), html(), val(), addClass()

Eventos
bind(), trigger(), unbind(), live(), click()

Efectos
show(), fadeOut(), toggle(), animate()

Traversing
find(), is(), prevAll(), next(), hasClass()

Ajax
Atributos
Get                  Set

.attr(‘id’)          .attr(‘id’, ‘pie’)
.html()              .html(‘<p>hola </p>’)
.val()               .val(‘nuevo valor’)
.css(‘top’)          .css(‘top’, ‘50px’)
. hasClass(‘link’)   .addClass(‘oculto’)
Eventos
$(‘div[id=alerta]).click(function(){
      $(this).hide();
});


$(‘p’).hover(function(){
      $(this).css(‘color’, ‘red’)
});
Efectos y Animaciones
$("button").click(function () {
     $("p").slideToggle("slow");
   });


$("#right").click(function(){
  $(".block").animate({"left": "+=50px"}, "slow");
});

$("#left").click(function(){
  $(".block").animate({"left": "-=50px"}, "slow");
});
Traversing
  $("#miCelda");

<html>
 <body>
  <table><tr>
    <td></td>
    <td></td>
    <td id="miCelda">
    <td></td>
  </tr></table>
 </body>
</html>
Traversing
$("#miCelda").prevAll();

<html>
 <body>
  <table><tr>
    <td></td>
    <td></td>
    <td id="miCelda">
    <td></td>
  </tr></table>
 </body>
</html>
Traversing
$("#miCelda").prevAll().andSelf()

<html>
 <body>
  <table><tr>
    <td></td>
    <td></td>
    <td id="miCelda">
    <td></td>
  </tr></table>
 </body>
</html>
Traversing
$("table");

<html>
 <body>
  <table>...</table>
    <div>
     <p>Hola</p>
     <span>Chau</span>
   </div>
 </body>
</html>
Traversing
$("table").next()

<html>
 <body>
  <table>...</table>
    <div>
     <p>Hola</p>
     <span>Chau</span>
   </div>
 </body>
</html>
Traversing
$("table").next().find(“p”)

<html>
 <body>
  <table>...</table>
    <div>
     <p>Hola</p>
     <span>Chau</span>
   </div>
 </body>
</html>
Ajax
      $.ajax({
       type: 'POST/GET',
       url: url,
       data: data,
       success: success
       dataType: dataType
});

$.get(...)

$.post(...)
Ajax
$.get('ajax/prueba.html', function(data) {
    $('#contenido').html(data);
});


<html>
 <body>
    <div id=”contenido”>
     ....
   </div>
 </body>
</html>
Ajax
$.get('ajax/prueba.html', function(data) {
  data = extraer_contenido();
  $('#contenido').html(data);
});


<html>
 <body>
    <div id=”contenido”>
     <p>Esto es ajax !!!</p>
   </div>
 </body>
</html>
Plugins
    $.fn.miPlugin = function(){
  return this.each(function(){
      $(this).html("Esto es un plugin!!!");
  });
});




<html>
 <body>
    <div></div>
    <div></div>
 </body>
</html>
Plugins
$.fn.miPlugin = function(){
  return this.each(function(){
      $(this).html("Esto es un plugin!!!");
  });
});


$("div").miPlugin();

<html>
 <body>
    <div>Esto es un plugin!!!</div>
    <div>Esto es un plugin!!!</div>
 </body>
</html>
Plugins
Plugins
Muchas gracias !!!



@Rlizardoceliz

More Related Content

Viewers also liked

Revision booklet 6957 2016
Revision booklet 6957 2016Revision booklet 6957 2016
Revision booklet 6957 2016
jom1987
 
Euro Myths
Euro MythsEuro Myths
Euro Myths
jom1987
 
Innotech Alno2010 March 2010
Innotech Alno2010 March 2010Innotech Alno2010 March 2010
Innotech Alno2010 March 2010
Prashant Welling
 
Presenting Alno Geman Kitchens 2011
Presenting Alno Geman Kitchens  2011Presenting Alno Geman Kitchens  2011
Presenting Alno Geman Kitchens 2011
Prashant Welling
 
Marketing 16th aug 2012
Marketing 16th aug 2012Marketing 16th aug 2012
Marketing 16th aug 2012
Prashant Welling
 
Power teams 9th aug 2012
Power teams 9th aug 2012Power teams 9th aug 2012
Power teams 9th aug 2012
Prashant Welling
 
Salute to Business - Best Business Advice
Salute to Business - Best Business AdviceSalute to Business - Best Business Advice
Salute to Business - Best Business Advice
Winter Park Chamber of Commerce
 

Viewers also liked (9)

CSI Social Media
CSI Social MediaCSI Social Media
CSI Social Media
 
CSI Social Media
CSI Social MediaCSI Social Media
CSI Social Media
 
Revision booklet 6957 2016
Revision booklet 6957 2016Revision booklet 6957 2016
Revision booklet 6957 2016
 
Euro Myths
Euro MythsEuro Myths
Euro Myths
 
Innotech Alno2010 March 2010
Innotech Alno2010 March 2010Innotech Alno2010 March 2010
Innotech Alno2010 March 2010
 
Presenting Alno Geman Kitchens 2011
Presenting Alno Geman Kitchens  2011Presenting Alno Geman Kitchens  2011
Presenting Alno Geman Kitchens 2011
 
Marketing 16th aug 2012
Marketing 16th aug 2012Marketing 16th aug 2012
Marketing 16th aug 2012
 
Power teams 9th aug 2012
Power teams 9th aug 2012Power teams 9th aug 2012
Power teams 9th aug 2012
 
Salute to Business - Best Business Advice
Salute to Business - Best Business AdviceSalute to Business - Best Business Advice
Salute to Business - Best Business Advice
 

Similar to Mini charla jquery

Aspetos gerais de desenvolvimento web.
Aspetos gerais de desenvolvimento web.Aspetos gerais de desenvolvimento web.
Aspetos gerais de desenvolvimento web.Corcioli
 
HTML&CSS 1 - Introduction to HTML
HTML&CSS 1 - Introduction to HTMLHTML&CSS 1 - Introduction to HTML
HTML&CSS 1 - Introduction to HTML
Dinis Correia
 
N03 app engineseminar
N03 app engineseminarN03 app engineseminar
N03 app engineseminarSun-Jin Jang
 
ADO.NET Entity Framework 4
ADO.NET Entity Framework 4ADO.NET Entity Framework 4
ADO.NET Entity Framework 4Raffaele Fanizzi
 
Core rest edgarsilva_v1
Core rest edgarsilva_v1Core rest edgarsilva_v1
Core rest edgarsilva_v1Edgar Silva
 
CodeFest 2010. Желтов А. — Погружение в Internet Explorer 9 для разработчиков
CodeFest 2010. Желтов А. — Погружение в Internet Explorer 9 для разработчиковCodeFest 2010. Желтов А. — Погружение в Internet Explorer 9 для разработчиков
CodeFest 2010. Желтов А. — Погружение в Internet Explorer 9 для разработчиковCodeFest
 
Fatih BAZMAN CodeIgniter Sunumu
Fatih BAZMAN CodeIgniter SunumuFatih BAZMAN CodeIgniter Sunumu
Fatih BAZMAN CodeIgniter Sunumu
Fatih Bazman
 
Komplexe Sites sauber aufbauen
Komplexe Sites sauber aufbauenKomplexe Sites sauber aufbauen
Komplexe Sites sauber aufbauen
Jens Grochtdreis
 
Türsteher für Bohnen
Türsteher für BohnenTürsteher für Bohnen
Türsteher für Bohnen
Zambrovski Simon
 
Einfuehrung in YAML (2010)
Einfuehrung in YAML (2010)Einfuehrung in YAML (2010)
Einfuehrung in YAML (2010)
Jens Grochtdreis
 
03 3-create-db-application-ado-dot-net Create Database Application with using...
03 3-create-db-application-ado-dot-net Create Database Application with using...03 3-create-db-application-ado-dot-net Create Database Application with using...
03 3-create-db-application-ado-dot-net Create Database Application with using...Warawut
 

Similar to Mini charla jquery (13)

Aspetos gerais de desenvolvimento web.
Aspetos gerais de desenvolvimento web.Aspetos gerais de desenvolvimento web.
Aspetos gerais de desenvolvimento web.
 
MS Swit 2010
MS Swit 2010MS Swit 2010
MS Swit 2010
 
HTML&CSS 1 - Introduction to HTML
HTML&CSS 1 - Introduction to HTMLHTML&CSS 1 - Introduction to HTML
HTML&CSS 1 - Introduction to HTML
 
N03 app engineseminar
N03 app engineseminarN03 app engineseminar
N03 app engineseminar
 
ADO.NET Entity Framework 4
ADO.NET Entity Framework 4ADO.NET Entity Framework 4
ADO.NET Entity Framework 4
 
Core rest edgarsilva_v1
Core rest edgarsilva_v1Core rest edgarsilva_v1
Core rest edgarsilva_v1
 
CodeFest 2010. Желтов А. — Погружение в Internet Explorer 9 для разработчиков
CodeFest 2010. Желтов А. — Погружение в Internet Explorer 9 для разработчиковCodeFest 2010. Желтов А. — Погружение в Internet Explorer 9 для разработчиков
CodeFest 2010. Желтов А. — Погружение в Internet Explorer 9 для разработчиков
 
Fatih BAZMAN CodeIgniter Sunumu
Fatih BAZMAN CodeIgniter SunumuFatih BAZMAN CodeIgniter Sunumu
Fatih BAZMAN CodeIgniter Sunumu
 
Komplexe Sites sauber aufbauen
Komplexe Sites sauber aufbauenKomplexe Sites sauber aufbauen
Komplexe Sites sauber aufbauen
 
初识 Html5
初识 Html5初识 Html5
初识 Html5
 
Türsteher für Bohnen
Türsteher für BohnenTürsteher für Bohnen
Türsteher für Bohnen
 
Einfuehrung in YAML (2010)
Einfuehrung in YAML (2010)Einfuehrung in YAML (2010)
Einfuehrung in YAML (2010)
 
03 3-create-db-application-ado-dot-net Create Database Application with using...
03 3-create-db-application-ado-dot-net Create Database Application with using...03 3-create-db-application-ado-dot-net Create Database Application with using...
03 3-create-db-application-ado-dot-net Create Database Application with using...
 

Mini charla jquery

Editor's Notes