SlideShare a Scribd company logo
1 of 22
Download to read offline
Belajar Ajax dengan jQuery dan VueJs
By : Edi Santoso
Events :
Workshop teknis javascript
7 November 2015
SMK Telkom Sandhy Putra Malang
About me...
Nothing special …
Backend Developer
PHP (Laravel Framework & Ruby On Rails)
Frontend Developer
(jQuery, Vue.js, AngularJs, Bootstrap and
Material Design)
Javascript Frameworks...
The preparation (source code)...
Clone the repo
https://github.com/cyberid41/belajar-ajax-dengan-
jquery-dan-vuejs
The preparation (dev tools)...
jQuery...
● memanipulasi DOM
● Memisahkan JavaScript dan HTML
● Syntax Singkat dan Jelas
● Mengatasi masalah kompatibilitas
antar-browser
● Ekstensibel
http://ekajogja.com/jquery-definisi-fitur-penggunaan
-jquery-dalam-pengembangan-website/
.val()
function displayValue() {
var name = $("#name").val();
$("#display-text").text(name);
console.log(name);
}
.text() .removeClass .addClass()
function changeClass() {
var name = $("#class-name").val();
$("#display-class-
name").text(name).removeClass('help-
block').addClass("text-success");
console.log(name);
}
.attr()
function addAttr() {
var name = $("#name1").val();
$("#display-
text1").text(name).attr("title", name);
console.log(name);
}
.removeClass() .addClass()
// remove class hide
function showForm() {
$("#myForm").removeClass("hide");
}
// add class hide
function hideForm() {
$("#myForm").addClass("hide");
}
.onkeyup()
// Event key up
function eventKeyUp(val) {
console.log(val);
$("#display-cari").text(val);
}
// html
<input id="cari" class="form-control"
onkeyup="eventKeyUp(this.value)">
.onkeypress()
// Event key down
function eventKeyDown(val) {
console.log(val);
$("#display-cari1").text(val);
}
// html
<input id="cari1" class="form-control"
onkeypress="eventKeyDown(this.value)">
Some cool stuff...
.append()
.html()
.bind()
.hide()
.show()
VueJs...
● Simple
● Reactive
● Components
● Compact
● Fast
● Package ready
http://vuejs.org/
instance...
new Vue({
el: '#hello',
data: {
message: 'Hello Vue.js!'
}
});
Two way data binding...
// js
new Vue({
el: '#way',
data: {
message: 'Hello Vue.js!'
}
});
// html
<div class="form-group" id="way">
<label>Text Input</label>
<input class="form-control" v-model="message">
<p class="help-block">{{ message }}</p>
</div>
Render a list...
// Menampilkan list data
new Vue({
el: '#list',
data: {
todos: [
{text: 'Learn JavaScript'},
{text: 'Learn Vue.js'},
{text: 'Build Something Awesome'}
]
}
});
// html
<div class="panel-body" id="list">
<ul class="list-group">
<li class="list-group-item" v-for="todo in todos">
{{ todo.text }}
</li>
</ul>
</div>
Render a list (part 1)...
new Vue({
el: '#app',
data: {
newTodo: '',
todos: [
{text: 'Add some todos'}
]
},
methods: {
addTodo: function () {
var text = this.newTodo.trim()
if (text) {
this.todos.push({text: text})
this.newTodo = ''
}
},
removeTodo: function (index) {
this.todos.splice(index, 1)
}
}
})
Render a list (part 2)...
<div class="form-group" id="app">
<input class="form-control" v-model="newTodo" v-on:keyup.enter="addTodo">
<span class="clearfix"><hr></span>
<ul class="list-group">
<li class="list-group-item" v-for="todo in todos">
{{ todo.text }}
<span class="pull-right">
<button v-on:click="removeTodo($index)"
class="btn btn-danger fa fa-trash-o">
</button></span>
</li>
</ul>
</div>
Some cool stuff...
Vue.directive
Vue.filter
Vue.component
Methods
Data
El
Created
Ready
Components
V-text
V-html
V-if
V-show
V-show
V-else
V-on
V-model
capitalize
uppercase
lowercase
currency
pluralize
json
debounce
limitBy
filterBy
orderBy
Our Community
Malang PHP
https://www.facebook.com/groups/mphug/
MalangJs
https://www.facebook.com/groups/malangjs/
Meetup & event
http://www.meetup.com/Malang-Js
Official sites
http://malangphp.org/
Thank's you...
@cyberid41
fb.com/cyberid41
id.linkedin.com/in/cyberid41
http://github.com/cyberid41
●
Stay in touch

More Related Content

What's hot

Intro to jQuery UI
Intro to jQuery UIIntro to jQuery UI
Intro to jQuery UIappendTo
 
ສ້າງລະບົບ Loin ດ້ວຍ php
ສ້າງລະບົບ Loin ດ້ວຍ phpສ້າງລະບົບ Loin ດ້ວຍ php
ສ້າງລະບົບ Loin ດ້ວຍ phpBounsong Byv
 
Javascript and jQuery for Mobile
Javascript and jQuery for MobileJavascript and jQuery for Mobile
Javascript and jQuery for MobileIvano Malavolta
 
jQuery - Javascript para quem não sabe Javascript
jQuery - Javascript para quem não sabe JavascriptjQuery - Javascript para quem não sabe Javascript
jQuery - Javascript para quem não sabe JavascriptNando Vieira
 
10 Programación Web con .NET y C#
10 Programación Web con .NET y C#10 Programación Web con .NET y C#
10 Programación Web con .NET y C#guidotic
 
Belajar Android Studio CRUD Data Mahasiswa
Belajar Android Studio CRUD Data MahasiswaBelajar Android Studio CRUD Data Mahasiswa
Belajar Android Studio CRUD Data MahasiswaAgus Haryanto
 
Validando Formulários com AngularJS
Validando Formulários com AngularJSValidando Formulários com AngularJS
Validando Formulários com AngularJSRodrigo Branas
 
Android Fast Track CRUD Android PHP MySql
Android Fast Track CRUD Android PHP MySqlAndroid Fast Track CRUD Android PHP MySql
Android Fast Track CRUD Android PHP MySqlAgus Haryanto
 
Utilizando diretivas com AngularJS
Utilizando diretivas com AngularJSUtilizando diretivas com AngularJS
Utilizando diretivas com AngularJSRodrigo Branas
 
Introduction à Marionette
Introduction à MarionetteIntroduction à Marionette
Introduction à MarionetteRaphaël Lemaire
 
Aplicando filtros com AngularJS
Aplicando filtros com AngularJSAplicando filtros com AngularJS
Aplicando filtros com AngularJSRodrigo Branas
 
Jquery Preparation
Jquery PreparationJquery Preparation
Jquery Preparationumesh patil
 
アプリ設定の保存をシンプルに
アプリ設定の保存をシンプルにアプリ設定の保存をシンプルに
アプリ設定の保存をシンプルにsusan335
 
Working With Ajax Frameworks
Working With Ajax FrameworksWorking With Ajax Frameworks
Working With Ajax FrameworksJonathan Snook
 
Analytics workshop deel 2
Analytics workshop deel 2Analytics workshop deel 2
Analytics workshop deel 2Tim Stierman
 

What's hot (20)

Intro to jQuery UI
Intro to jQuery UIIntro to jQuery UI
Intro to jQuery UI
 
Prototype UI
Prototype UIPrototype UI
Prototype UI
 
ສ້າງລະບົບ Loin ດ້ວຍ php
ສ້າງລະບົບ Loin ດ້ວຍ phpສ້າງລະບົບ Loin ດ້ວຍ php
ສ້າງລະບົບ Loin ດ້ວຍ php
 
Javascript and jQuery for Mobile
Javascript and jQuery for MobileJavascript and jQuery for Mobile
Javascript and jQuery for Mobile
 
jQuery - Javascript para quem não sabe Javascript
jQuery - Javascript para quem não sabe JavascriptjQuery - Javascript para quem não sabe Javascript
jQuery - Javascript para quem não sabe Javascript
 
10 Programación Web con .NET y C#
10 Programación Web con .NET y C#10 Programación Web con .NET y C#
10 Programación Web con .NET y C#
 
Web2.0 with jQuery
Web2.0 with jQueryWeb2.0 with jQuery
Web2.0 with jQuery
 
Belajar Android Studio CRUD Data Mahasiswa
Belajar Android Studio CRUD Data MahasiswaBelajar Android Studio CRUD Data Mahasiswa
Belajar Android Studio CRUD Data Mahasiswa
 
Jquery ui, ajax
Jquery ui, ajaxJquery ui, ajax
Jquery ui, ajax
 
Validando Formulários com AngularJS
Validando Formulários com AngularJSValidando Formulários com AngularJS
Validando Formulários com AngularJS
 
Android Fast Track CRUD Android PHP MySql
Android Fast Track CRUD Android PHP MySqlAndroid Fast Track CRUD Android PHP MySql
Android Fast Track CRUD Android PHP MySql
 
Utilizando diretivas com AngularJS
Utilizando diretivas com AngularJSUtilizando diretivas com AngularJS
Utilizando diretivas com AngularJS
 
Introduction à Marionette
Introduction à MarionetteIntroduction à Marionette
Introduction à Marionette
 
Web components v1 intro
Web components v1 introWeb components v1 intro
Web components v1 intro
 
Asp .net Jquery
Asp .net JqueryAsp .net Jquery
Asp .net Jquery
 
Aplicando filtros com AngularJS
Aplicando filtros com AngularJSAplicando filtros com AngularJS
Aplicando filtros com AngularJS
 
Jquery Preparation
Jquery PreparationJquery Preparation
Jquery Preparation
 
アプリ設定の保存をシンプルに
アプリ設定の保存をシンプルにアプリ設定の保存をシンプルに
アプリ設定の保存をシンプルに
 
Working With Ajax Frameworks
Working With Ajax FrameworksWorking With Ajax Frameworks
Working With Ajax Frameworks
 
Analytics workshop deel 2
Analytics workshop deel 2Analytics workshop deel 2
Analytics workshop deel 2
 

Viewers also liked

WADe 2014—2015 (03/12): Arhitectura aplicaţiilor Web orientate spre servicii
WADe 2014—2015 (03/12): Arhitectura aplicaţiilor Web orientate spre serviciiWADe 2014—2015 (03/12): Arhitectura aplicaţiilor Web orientate spre servicii
WADe 2014—2015 (03/12): Arhitectura aplicaţiilor Web orientate spre serviciiSabin Buraga
 
Introduction to OOP with PHP
Introduction to OOP with PHPIntroduction to OOP with PHP
Introduction to OOP with PHPMichael Peacock
 
Pengenalan AngularJS
Pengenalan AngularJSPengenalan AngularJS
Pengenalan AngularJSEdi Santoso
 
jQuery Mobile Jump Start
jQuery Mobile Jump StartjQuery Mobile Jump Start
jQuery Mobile Jump StartTroy Miles
 
Building jQuery Mobile Web Apps
Building jQuery Mobile Web AppsBuilding jQuery Mobile Web Apps
Building jQuery Mobile Web AppsOperation Mobile
 
Introduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for AllIntroduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for AllMarc Grabanski
 

Viewers also liked (10)

WADe 2014—2015 (03/12): Arhitectura aplicaţiilor Web orientate spre servicii
WADe 2014—2015 (03/12): Arhitectura aplicaţiilor Web orientate spre serviciiWADe 2014—2015 (03/12): Arhitectura aplicaţiilor Web orientate spre servicii
WADe 2014—2015 (03/12): Arhitectura aplicaţiilor Web orientate spre servicii
 
Jquery ajax
Jquery ajaxJquery ajax
Jquery ajax
 
Introduction to OOP with PHP
Introduction to OOP with PHPIntroduction to OOP with PHP
Introduction to OOP with PHP
 
Beginning OOP in PHP
Beginning OOP in PHPBeginning OOP in PHP
Beginning OOP in PHP
 
Pengenalan AngularJS
Pengenalan AngularJSPengenalan AngularJS
Pengenalan AngularJS
 
jQuery Ajax
jQuery AjaxjQuery Ajax
jQuery Ajax
 
jQuery Mobile Jump Start
jQuery Mobile Jump StartjQuery Mobile Jump Start
jQuery Mobile Jump Start
 
Building jQuery Mobile Web Apps
Building jQuery Mobile Web AppsBuilding jQuery Mobile Web Apps
Building jQuery Mobile Web Apps
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
Introduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for AllIntroduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for All
 

Workshop Teknis Javascript SMK Telkom Sandhy Putra Malang