SlideShare ist ein Scribd-Unternehmen logo
1 von 16
JavaScriptMVC ,[object Object]
JavaScriptMVC ,[object Object]
document.getElementById("box").style.display = "block";
JavaScriptMVC ,[object Object]
$(”box”).attr(”display ”, ”block”);
$(”box”).show();
JavaScriptMVC ,[object Object]
jQuery.Controller.extend('BoxController', ,[object Object]
{
init: function (el) {
this._super(el); ,[object Object],[object Object]
} ,[object Object]
JavaScriptMVC ,[object Object]
JavaScriptMVC ,[object Object]
Una aplicación donde buscas imagenes en Flickr y las agregas a tu galería donde podes acomodarlas.
Vamos a ver como hacemos lo mismo con  y sin JavaScriptMVC

Weitere ähnliche Inhalte

Was ist angesagt?

Back To The Front - Javascript Test Driven Development is between us (workshop)
Back To The Front - Javascript Test Driven Development is between us (workshop)Back To The Front - Javascript Test Driven Development is between us (workshop)
Back To The Front - Javascript Test Driven Development is between us (workshop)Marco Cedaro
 
An introduction to Ember framework
An introduction to Ember frameworkAn introduction to Ember framework
An introduction to Ember frameworkDiana Falkowska
 
Crea un tema compatibile con le ultime novità WordPress
Crea un tema compatibile con le ultime novità WordPressCrea un tema compatibile con le ultime novità WordPress
Crea un tema compatibile con le ultime novità WordPressSkillsAndMore
 
Angular 2 не так уж и плох... А если задуматься, то и просто хорош / Алексей ...
Angular 2 не так уж и плох... А если задуматься, то и просто хорош / Алексей ...Angular 2 не так уж и плох... А если задуматься, то и просто хорош / Алексей ...
Angular 2 не так уж и плох... А если задуматься, то и просто хорош / Алексей ...Ontico
 
Peek inside the fantastical Ukrainian Village home and studio of artists Jare...
Peek inside the fantastical Ukrainian Village home and studio of artists Jare...Peek inside the fantastical Ukrainian Village home and studio of artists Jare...
Peek inside the fantastical Ukrainian Village home and studio of artists Jare...irwinvifxcfesre
 
Animação com jQuery
Animação com jQueryAnimação com jQuery
Animação com jQuerydouglasgrava
 
噗浪最近有點胖
噗浪最近有點胖噗浪最近有點胖
噗浪最近有點胖Irvin Chen
 
Twig, los mejores trucos y técnicas avanzadas
Twig, los mejores trucos y técnicas avanzadasTwig, los mejores trucos y técnicas avanzadas
Twig, los mejores trucos y técnicas avanzadasJavier Eguiluz
 
jQuery Plugins Intro
jQuery Plugins IntrojQuery Plugins Intro
jQuery Plugins IntroCasey West
 
Introduction à Marionette
Introduction à MarionetteIntroduction à Marionette
Introduction à MarionetteRaphaël Lemaire
 
Angular 2のRenderer
Angular 2のRendererAngular 2のRenderer
Angular 2のRendererYosuke Onoue
 
WordPress Customizer
WordPress CustomizerWordPress Customizer
WordPress Customizerslicejack
 
JQuery应用开发
JQuery应用开发JQuery应用开发
JQuery应用开发chevionlu
 
UISearchController par Stéphane sudre
UISearchController par Stéphane sudreUISearchController par Stéphane sudre
UISearchController par Stéphane sudreCocoaHeads France
 
Chief Keef's hologram can't catch a break, and it's a win for Keef
Chief Keef's hologram can't catch a break, and it's a win for KeefChief Keef's hologram can't catch a break, and it's a win for Keef
Chief Keef's hologram can't catch a break, and it's a win for Keefchicagonewsonlineradio
 

Was ist angesagt? (20)

Back To The Front - Javascript Test Driven Development is between us (workshop)
Back To The Front - Javascript Test Driven Development is between us (workshop)Back To The Front - Javascript Test Driven Development is between us (workshop)
Back To The Front - Javascript Test Driven Development is between us (workshop)
 
An introduction to Ember framework
An introduction to Ember frameworkAn introduction to Ember framework
An introduction to Ember framework
 
Crea un tema compatibile con le ultime novità WordPress
Crea un tema compatibile con le ultime novità WordPressCrea un tema compatibile con le ultime novità WordPress
Crea un tema compatibile con le ultime novità WordPress
 
Angular 2 не так уж и плох... А если задуматься, то и просто хорош / Алексей ...
Angular 2 не так уж и плох... А если задуматься, то и просто хорош / Алексей ...Angular 2 не так уж и плох... А если задуматься, то и просто хорош / Алексей ...
Angular 2 не так уж и плох... А если задуматься, то и просто хорош / Алексей ...
 
Peek inside the fantastical Ukrainian Village home and studio of artists Jare...
Peek inside the fantastical Ukrainian Village home and studio of artists Jare...Peek inside the fantastical Ukrainian Village home and studio of artists Jare...
Peek inside the fantastical Ukrainian Village home and studio of artists Jare...
 
Prototype UI
Prototype UIPrototype UI
Prototype UI
 
Animação com jQuery
Animação com jQueryAnimação com jQuery
Animação com jQuery
 
噗浪最近有點胖
噗浪最近有點胖噗浪最近有點胖
噗浪最近有點胖
 
Twig, los mejores trucos y técnicas avanzadas
Twig, los mejores trucos y técnicas avanzadasTwig, los mejores trucos y técnicas avanzadas
Twig, los mejores trucos y técnicas avanzadas
 
jQuery Plugins Intro
jQuery Plugins IntrojQuery Plugins Intro
jQuery Plugins Intro
 
Introduction à Marionette
Introduction à MarionetteIntroduction à Marionette
Introduction à Marionette
 
Angular 2のRenderer
Angular 2のRendererAngular 2のRenderer
Angular 2のRenderer
 
WordPress Customizer
WordPress CustomizerWordPress Customizer
WordPress Customizer
 
JQuery应用开发
JQuery应用开发JQuery应用开发
JQuery应用开发
 
Templating WordPress
Templating WordPressTemplating WordPress
Templating WordPress
 
UISearchController par Stéphane sudre
UISearchController par Stéphane sudreUISearchController par Stéphane sudre
UISearchController par Stéphane sudre
 
JSF 2 and Ajax
JSF 2 and  AjaxJSF 2 and  Ajax
JSF 2 and Ajax
 
Jquery Framework
Jquery FrameworkJquery Framework
Jquery Framework
 
Chief Keef's hologram can't catch a break, and it's a win for Keef
Chief Keef's hologram can't catch a break, and it's a win for KeefChief Keef's hologram can't catch a break, and it's a win for Keef
Chief Keef's hologram can't catch a break, and it's a win for Keef
 
Web App Mvc
Web App MvcWeb App Mvc
Web App Mvc
 

Andere mochten auch

Le pic de Hubert
Le pic de HubertLe pic de Hubert
Le pic de Hubertacrespel
 
X efficiency of commercial banks in kenya
X efficiency of commercial banks in kenyaX efficiency of commercial banks in kenya
X efficiency of commercial banks in kenyaAlexander Decker
 
Analytics services 2013
Analytics services 2013Analytics services 2013
Analytics services 2013Afsar Ali
 
Zakah
ZakahZakah
Zakah16dnh
 
Introduction of gastrointestinal tract
Introduction of gastrointestinal tractIntroduction of gastrointestinal tract
Introduction of gastrointestinal tractRajesh Goit
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphicsAmandeep Kaur
 

Andere mochten auch (8)

Le pic de Hubert
Le pic de HubertLe pic de Hubert
Le pic de Hubert
 
X efficiency of commercial banks in kenya
X efficiency of commercial banks in kenyaX efficiency of commercial banks in kenya
X efficiency of commercial banks in kenya
 
Marketing Segmentation
Marketing SegmentationMarketing Segmentation
Marketing Segmentation
 
Vero
VeroVero
Vero
 
Analytics services 2013
Analytics services 2013Analytics services 2013
Analytics services 2013
 
Zakah
ZakahZakah
Zakah
 
Introduction of gastrointestinal tract
Introduction of gastrointestinal tractIntroduction of gastrointestinal tract
Introduction of gastrointestinal tract
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphics
 

JavascriptMVC

  • 1.
  • 2.
  • 4.
  • 7.
  • 8.
  • 9. {
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. Una aplicación donde buscas imagenes en Flickr y las agregas a tu galería donde podes acomodarlas.
  • 16. Vamos a ver como hacemos lo mismo con y sin JavaScriptMVC
  • 17. (sin framework pero con JQuery, tampoco tengo tanto tiempo libre che!)
  • 18.
  • 19. JavaScriptMVC $( function () { // load $.get( &quot;/server/get.php&quot; , function (images) { for ( var i = 0; i < images.length; i++) { addImageToGallery(images[i]); } }, &quot;json&quot; ); }); function addImageToGallery(data) { var link, img, li; link = $( &quot;<a></a>&quot; ).attr( &quot;href&quot; , data.src.replace( /_m/ , &quot;.&quot; )); img = data; img.alt = img.title; img.src = data.src.replace( /_m/ , &quot;_s.&quot; ); li = $( &quot;<li></li>&quot; ).attr( &quot;id&quot; , &quot;image_item_&quot; + data.id); delete img.id; link.append($( &quot;<img />&quot; ).attr(img)); link.lightBox({eventType: &quot;dblclick&quot; }); li.append(link); $( &quot;#gallery&quot; ).append(li); }
  • 21.
  • 22.
  • 23.
  • 24. JavaScriptMVC $( &quot;#search form&quot; ).submit( function (event) { event.preventDefault(); flickrSearch($( this .q).val(), function (items) { var html = &quot;<ul>&quot; ; var item; for ( var i = 0; i < items.length; i++) { item = items[i]; html += &quot;<li title=amp;quot;Click to addamp;quot;><img src='&quot; + item.media.m + &quot;' />&quot; ; html += &quot;<p>&quot; + item.title + &quot;</p></li>&quot; ; } html += &quot;</ul>&quot; ; $( &quot;#search_results&quot; ).html(html); $( &quot;#search_results&quot; ).show(); }); return false ; }); $( &quot;#toggle_results&quot; ).click( function () { $( &quot;#search_results&quot; ).toggle(); }); $( &quot;#search_results li&quot; ).live( &quot;click&quot; , function () { var o = { src: $( &quot;img&quot; , this ).attr( &quot;src&quot; ), title: $( &quot;p&quot; , this ).html() }; $.post( &quot;/server/save.php&quot; , o, function (response) { addImageToGallery(response); }, &quot;json&quot; ); $( &quot;#search_results&quot; ).hide(); });
  • 25. JavaScriptMVC jQuery.Controller.extend( 'SearchController' , {}, { &quot;form submit&quot; : function (el, ev) { ev.preventDefault(); Flickr.search( this .element.find( &quot;input&quot; ).val(), this .callback( &quot;showResults&quot; )); }, showResults: function (results) { var html = this .view( &quot;results&quot; , {results: results}); $( &quot;#search_results&quot; ).html(html).show(); }, &quot;#toggle_results a click&quot; : function (el, ev) { $( &quot;#search_results&quot; ).toggle(); ev.preventDefault(); }, &quot;#search_results li click&quot; : function (el) { var image = new ImageItem({ src: $( &quot;img&quot; , el).attr( &quot;src&quot; ), title: $( &quot;p&quot; , el).html() }); image.save( function (imageModel) { $( &quot;#gallery&quot; ).controller().addImage(imageModel); }); $( &quot;#search_results&quot; ).hide(); } });
  • 26.
  • 27.