<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
</head>
<body>
<script type="text/javascript">
if(Modernizr.geolocation){
document.getElementsByTagName('body')[0].innerHTML+='<h2>支援geolocation</h2>';
}
if(Modernizr.canvas){
document.getElementsByTagName('body')[0].innerHTML+='<h2>支援canvas</h2>';
}
if(Modernizr.flash){
document.getElementsByTagName('body')[0].innerHTML+='<h2>支援flash</h2>';
}
</script>
</body>
</html>
Jerry 發表在 痞客邦 留言(0) 人氣(0)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
</head>
<body>
<script type="text/javascript">
if(Modernizr.geolocation){
document.getElementsByTagName('body')[0].innerHTML+='<h2>支援geolocation</h2>';
}
if(Modernizr.canvas){
document.getElementsByTagName('body')[0].innerHTML+='<h2>支援canvas</h2>';
}
if(Modernizr.flash){
document.getElementsByTagName('body')[0].innerHTML+='<h2>支援flash</h2>';
}
</script>
</body>
</html>
Jerry 發表在 痞客邦 留言(0) 人氣(8)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<button id="btn">按我</button>
<div id="result"></div>
<a href="http://www.google.com">先去一下google再回來按</a>
<script type="text/javascript">
if(!localStorage['clickcount']){
var i =0;
}else{
i=localStorage['clickcount'];
}
document.getElementById('btn').onclick=function(){
i++;
localStorage.setItem('clickcount',i);
for (var j = 0; j < localStorage.length; j++) {
document.getElementById('result').innerHTML='<h2>localSotorage的「'+localStorage.key(j)+'」欄位紀錄的資料是「'+localStorage.getItem(localStorage.key(j))+'」</h2>';
}
}
</script>
</body>
</html>
Jerry 發表在 痞客邦 留言(0) 人氣(0)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<button id="btn">按我</button>
<div id="result"></div>
<a href="http://www.google.com">先去一下google再回來按</a>
<script type="text/javascript">
if(!localStorage['clickcount']){
var i =0;
}else{
i=localStorage['clickcount'];
}
document.getElementById('btn').onclick=function(){
i++;
localStorage.setItem('clickcount',i);
for (var j = 0; j < localStorage.length; j++) {
document.getElementById('result').innerHTML='<h2>localSotorage的「'+localStorage.key(j)+'」欄位紀錄的資料是「'+localStorage.getItem(localStorage.key(j))+'」</h2>';
}
}
</script>
</body>
</html>
Jerry 發表在 痞客邦 留言(0) 人氣(40)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div id="content"></div>
<button id="btn">取得位置</button>
<script type="text/javascript">
document.getElementById('btn').onclick=function(){
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(function(position){
document.getElementById('content').innerHTML=
'你的位置緯度是:'+position.coords.latitude+'<br>'+
'你的位置經度是:'+position.coords.longitude;
});
}else{
document.getElementById('content').innerHTML='不支援喔'
}
}
</script>
</body>
</html>
Jerry 發表在 痞客邦 留言(0) 人氣(0)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div id="content"></div>
<button id="btn">取得位置</button>
<script type="text/javascript">
document.getElementById('btn').onclick=function(){
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(function(position){
document.getElementById('content').innerHTML=
'你的位置緯度是:'+position.coords.latitude+'<br>'+
'你的位置經度是:'+position.coords.longitude;
});
}else{
document.getElementById('content').innerHTML='不支援喔'
}
}
</script>
</body>
</html>
Jerry 發表在 痞客邦 留言(0) 人氣(23)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="0914-6.css">
</head>
<body>
<ul>
<li><a href="0914-6a.html">第1頁</a></li>
<li><a href="0914-6b.html">第2頁</a></li>
<li><a href="0914-6c.html">第3頁</a></li>
</ul>
<div id="content">
<div id="container">
<img src="https://api.fnkr.net/testimg/100x100/a00/FFF/?text=A">
</div>
</div>
<script type="text/javascript" src="0914-6.js"></script>
</body>
</html>
Jerry 發表在 痞客邦 留言(0) 人氣(0)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="0914-6.css">
</head>
<body>
<ul>
<li><a href="0914-6a.html">第1頁</a></li>
<li><a href="0914-6b.html">第2頁</a></li>
<li><a href="0914-6c.html">第3頁</a></li>
</ul>
<div id="content">
<div id="container">
<img src="https://api.fnkr.net/testimg/100x100/a00/FFF/?text=A">
</div>
</div>
<script type="text/javascript" src="0914-6.js"></script>
</body>
</html>
Jerry 發表在 痞客邦 留言(0) 人氣(871)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<style type="text/css">
a{
cursor: pointer;
}
</style>
</head>
<body>
<div id="content"></div>
<div id="reloadbox"></div>
<script type="text/javascript">
function getData(){
var content='';
$.getJSON('data/0914-5.json').done(function(data){
$.each(data,function(index,value){
content+='<h2>'+index+':'+value+'</h2>'
});
$('#content').html(content).hide().fadeIn();
}).fail(function(){
$('#content').text('沒有資料');
}).always(function(){
$('#reloadbox').html('<a id="reload">重新整理</a>');
$('#reload').on('click',function(e){
e.preventDefault();
getData();
});
});
}
getData();
</script>
</body>
</html>
Jerry 發表在 痞客邦 留言(0) 人氣(0)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<style type="text/css">
a{
cursor: pointer;
}
</style>
</head>
<body>
<div id="content"></div>
<div id="reloadbox"></div>
<script type="text/javascript">
function getData(){
var content='';
$.getJSON('data/0914-5.json').done(function(data){
$.each(data,function(index,value){
content+='<h2>'+index+':'+value+'</h2>'
});
$('#content').html(content).hide().fadeIn();
}).fail(function(){
$('#content').text('沒有資料');
}).always(function(){
$('#reloadbox').html('<a id="reload">重新整理</a>');
$('#reload').on('click',function(e){
e.preventDefault();
getData();
});
});
}
getData();
</script>
</body>
</html>
Jerry 發表在 痞客邦 留言(0) 人氣(385)