SlideShare une entreprise Scribd logo
1  sur  33
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




N. Shimizu (chiko@sfc.keio.ac.jp)
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




•               (API)   "
                                      "
       script   "

•  jQuery       HTML            "
•  Google Map JavaScript API V3                      "
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




jQuery

•  JavaScript                    "
       HTML                                               "
       2006    John Resig    "
       http://jquery.com/"

•             HTML                            "
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




      li

var items = document.getElementByTagName("li");	
for(var i = 0; i < items.length; i = i + 1){	
  items[i].style.color = "red";	
}
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




jQuery

 var items = document.getElementByTagName("li");	
 for(var i = 0; i < items.length; i = i + 1){	
   items[i].style.color = "red";	
 } 	



 $("li").css("color", "red");
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




jQuery

•  script
                           script                               "
      src   jQuery URL


<script src="http://ipl.sfc.keio.ac.jp/text/
pro-2011-9/lib/jquery-1.7.1.min.js"></script>
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




<ul>	
<li>Hello, World</li>	
<li>Hello, SFC</li>	
<li>Hello, Fujisawa</li>	
</ul>	
<input type="button" value="Click me">
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




$(            )

•  HTML                        "
                                                 "
             HTML          "

•            (selector)"
                                   "
       CSS
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




http://semooh.jp/jquery/api/selectors/ を参照のこと
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




var items;	
items = $("li");	
items.css("color", "white");	
items.css("font-size", "large");	
items.css("background-color", "#333333");
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




$("li").css({	
  color: "white",	
  bakcgroundColor:"#333333",	
  fontSize: "large"	
});
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




09-1
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




<input type="text" id="input">	
<script type="text/javascript">	
var i = document.getElementById("input").value;	
</script>	
	
<input type="text" id="input">	
<script type="text/javascript">	
var i = $("#input").val();	
</script>
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




<form>	
<input type="text" id="input">	
<input type="button" value="         " onclick="addItem()">	
</form>	
<ul id="#list">	
</ul>	
<script src="http://ipl.sfc.keio.ac.jp/text/
pro-2011-9/lib/jquery-1.7.1.min.js"></script>
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




function addItem(){	
     var i = $("#input").val();	
     var item = "<li>" + i + "</li>";	
     $("#list").append(item);	
}
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




HTML
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




function init(){	
     $("li").css("color", "red");	
}	
	
$(document).ready(init);
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




function init(){	
     $("li").css("color", "red");	
}	
	
$(init);
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




$(function(){	
  $("li").css("color", "red");	
});
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




function f1(a){	
     return a + 1;	
}	
	
var f2 = function(a){	
     return a + 1;	
};
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




                                       "
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




$(function(){	
  $("li").css("color", "red");	
});
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




function liClicked(){	
      $(this).css("color", "red");	
}	
$(function(){	
     $("li").click(liClicked);	
});	



              http://jsdo.it/Noritada.Shimizu/lwMJ にデモがあります
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




$(function(){	
  $("li").click(function(){	
       $(this).css("color", "red");	
  });	
});
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




http://semooh.jp/jquery/api/events/ を参照のこと
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




http://semooh.jp/jquery/api/events/ を参照のこと
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




09-2
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




Web
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




<div id="map" style="width:300px;height:300px"></div>	
<script type="text/javascript" src="http://maps.google.com/maps/api/
js?sensor=false"></script>	
<script type="text/javascript" src="http://ipl.sfc.keio.ac.jp/text/
pro-2011-9/lib/jquery-1.7.1.min.js"></script>	
<script type="text/javascript">	
$(function(){	
       var latlng = new google.maps.LatLng(35.388276, 139.427348);	
       //
  var opt = {	
            	zoom: 15,	
            	center: latlng,	
            	mapTypeId: google.maps.MapTypeId.ROADMAP	
       };	
       //
 var map = new google.maps.Map($("#map").get(0), opt);	
});	
</script>	

                      http://jsdo.it/Noritada.Shimizu/r3zs にデモがあります
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




Google Map JavaScript API V3

•  Google Map                                                         "
•             "
     http://code.google.com/intl/ja/apis/maps/documentation/
     javascript/"
                    "
    
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




04-3
N. Shimizu (chiko@sfc.keio.ac.jp / @chikoski)




            panTo

var map;	
$(function(){	
// GoogleMap                	
});	
function updateMap(){	
     var center = new LatLng(35, 139);	
     map.panTo(center);	
}	
 	
             http://jsdo.it/Noritada.Shimizu/8U7N

Contenu connexe

En vedette

Property registration new
Property registration newProperty registration new
Property registration newSelva Kumar
 
ведення вагітності
ведення  вагітностіведення  вагітності
ведення вагітностіagusya
 
evolutia mingii de fotbal
 evolutia mingii de fotbal evolutia mingii de fotbal
evolutia mingii de fotbalBaros07
 
Increasing reporting value with statistics
Increasing reporting value with statisticsIncreasing reporting value with statistics
Increasing reporting value with statisticsvraopolisetti
 
Remise des prix 2015 entente Frontalière
Remise des prix 2015 entente FrontalièreRemise des prix 2015 entente Frontalière
Remise des prix 2015 entente FrontalièreFabrice Carlier
 
Happy thanksgiving26
Happy thanksgiving26Happy thanksgiving26
Happy thanksgiving26nhuhoaautim
 
主成分回归分光光度法同时测定混合食用色素
主成分回归分光光度法同时测定混合食用色素 主成分回归分光光度法同时测定混合食用色素
主成分回归分光光度法同时测定混合食用色素 Leon Liang
 

En vedette (14)

Property registration new
Property registration newProperty registration new
Property registration new
 
2 power point
2 power point2 power point
2 power point
 
ведення вагітності
ведення  вагітностіведення  вагітності
ведення вагітності
 
Father's day of thailand
Father's day of thailandFather's day of thailand
Father's day of thailand
 
Food
FoodFood
Food
 
Piramidat
PiramidatPiramidat
Piramidat
 
evolutia mingii de fotbal
 evolutia mingii de fotbal evolutia mingii de fotbal
evolutia mingii de fotbal
 
Increasing reporting value with statistics
Increasing reporting value with statisticsIncreasing reporting value with statistics
Increasing reporting value with statistics
 
Temperature Transmitters
Temperature TransmittersTemperature Transmitters
Temperature Transmitters
 
Remise des prix 2015 entente Frontalière
Remise des prix 2015 entente FrontalièreRemise des prix 2015 entente Frontalière
Remise des prix 2015 entente Frontalière
 
Happy thanksgiving26
Happy thanksgiving26Happy thanksgiving26
Happy thanksgiving26
 
Todos los programas
Todos los programasTodos los programas
Todos los programas
 
Weight loss tips
Weight loss tipsWeight loss tips
Weight loss tips
 
主成分回归分光光度法同时测定混合食用色素
主成分回归分光光度法同时测定混合食用色素 主成分回归分光光度法同时测定混合食用色素
主成分回归分光光度法同时测定混合食用色素
 

Plus de Noritada Shimizu

20150512 webgl-off-the-main-thread
20150512 webgl-off-the-main-thread20150512 webgl-off-the-main-thread
20150512 webgl-off-the-main-threadNoritada Shimizu
 
asm.js x emscripten: The foundation of the next level Web games
asm.js x emscripten: The foundation of the next level Web gamesasm.js x emscripten: The foundation of the next level Web games
asm.js x emscripten: The foundation of the next level Web gamesNoritada Shimizu
 
Mozilla とブラウザゲーム
Mozilla とブラウザゲームMozilla とブラウザゲーム
Mozilla とブラウザゲームNoritada Shimizu
 
2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.jsNoritada Shimizu
 
20151128 firefoxos-handson
20151128 firefoxos-handson20151128 firefoxos-handson
20151128 firefoxos-handsonNoritada Shimizu
 
Inspection & Tweak: Firefox を使ったフロント開発
Inspection & Tweak: Firefox を使ったフロント開発Inspection & Tweak: Firefox を使ったフロント開発
Inspection & Tweak: Firefox を使ったフロント開発Noritada Shimizu
 
20150829 firefox-os-handson
20150829 firefox-os-handson20150829 firefox-os-handson
20150829 firefox-os-handsonNoritada Shimizu
 
20150727 Development tools for Firefox OS apps
20150727 Development tools for Firefox OS apps20150727 Development tools for Firefox OS apps
20150727 Development tools for Firefox OS appsNoritada Shimizu
 
Firefox OS でアプリを作るときに気をつけたい N 個のこと
Firefox OS  でアプリを作るときに気をつけたい N 個のことFirefox OS  でアプリを作るときに気をつけたい N 個のこと
Firefox OS でアプリを作るときに気をつけたい N 個のことNoritada Shimizu
 
Firefox OSアプリ開発ハンズオン(Hello World編)
Firefox OSアプリ開発ハンズオン(Hello World編)Firefox OSアプリ開発ハンズオン(Hello World編)
Firefox OSアプリ開発ハンズオン(Hello World編)Noritada Shimizu
 
WebVR(html5j TV部、WebVRとかVRのUIとか勉強会)
WebVR(html5j TV部、WebVRとかVRのUIとか勉強会)WebVR(html5j TV部、WebVRとかVRのUIとか勉強会)
WebVR(html5j TV部、WebVRとかVRのUIとか勉強会)Noritada Shimizu
 
Application submission, management and manetization in Firefox Marketplace
Application submission, management and manetization in Firefox MarketplaceApplication submission, management and manetization in Firefox Marketplace
Application submission, management and manetization in Firefox MarketplaceNoritada Shimizu
 

Plus de Noritada Shimizu (20)

20160803 devrel
20160803 devrel20160803 devrel
20160803 devrel
 
20160713 webvr
20160713 webvr20160713 webvr
20160713 webvr
 
20160601 devtools
20160601 devtools20160601 devtools
20160601 devtools
 
20150512 webgl-off-the-main-thread
20150512 webgl-off-the-main-thread20150512 webgl-off-the-main-thread
20150512 webgl-off-the-main-thread
 
20160428 html5jwebplat
20160428 html5jwebplat20160428 html5jwebplat
20160428 html5jwebplat
 
asm.js x emscripten: The foundation of the next level Web games
asm.js x emscripten: The foundation of the next level Web gamesasm.js x emscripten: The foundation of the next level Web games
asm.js x emscripten: The foundation of the next level Web games
 
Mozilla とブラウザゲーム
Mozilla とブラウザゲームMozilla とブラウザゲーム
Mozilla とブラウザゲーム
 
2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js
 
20151224-games
20151224-games20151224-games
20151224-games
 
20151128 firefoxos-handson
20151128 firefoxos-handson20151128 firefoxos-handson
20151128 firefoxos-handson
 
20151117 devtools
20151117 devtools20151117 devtools
20151117 devtools
 
Inspection & Tweak: Firefox を使ったフロント開発
Inspection & Tweak: Firefox を使ったフロント開発Inspection & Tweak: Firefox を使ったフロント開発
Inspection & Tweak: Firefox を使ったフロント開発
 
20150822 osc-shimane
20150822 osc-shimane20150822 osc-shimane
20150822 osc-shimane
 
20150829 firefox-os-handson
20150829 firefox-os-handson20150829 firefox-os-handson
20150829 firefox-os-handson
 
20150829 firefox-os
20150829 firefox-os20150829 firefox-os
20150829 firefox-os
 
20150727 Development tools for Firefox OS apps
20150727 Development tools for Firefox OS apps20150727 Development tools for Firefox OS apps
20150727 Development tools for Firefox OS apps
 
Firefox OS でアプリを作るときに気をつけたい N 個のこと
Firefox OS  でアプリを作るときに気をつけたい N 個のことFirefox OS  でアプリを作るときに気をつけたい N 個のこと
Firefox OS でアプリを作るときに気をつけたい N 個のこと
 
Firefox OSアプリ開発ハンズオン(Hello World編)
Firefox OSアプリ開発ハンズオン(Hello World編)Firefox OSアプリ開発ハンズオン(Hello World編)
Firefox OSアプリ開発ハンズオン(Hello World編)
 
WebVR(html5j TV部、WebVRとかVRのUIとか勉強会)
WebVR(html5j TV部、WebVRとかVRのUIとか勉強会)WebVR(html5j TV部、WebVRとかVRのUIとか勉強会)
WebVR(html5j TV部、WebVRとかVRのUIとか勉強会)
 
Application submission, management and manetization in Firefox Marketplace
Application submission, management and manetization in Firefox MarketplaceApplication submission, management and manetization in Firefox Marketplace
Application submission, management and manetization in Firefox Marketplace
 

ronpro2011f#09