歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux編程 >> Linux編程

HTML5入門學習筆記

HTML5入門學習筆記

1.canvas標簽

<canvas id="myCanvas"></canvas><!--canvas標簽定義圖形,比如圖標和其他圖像-->
<!-- html5的canvas元素使用Javascript在網頁上繪制圖像
畫布是一個矩形區域,可以控制每一個像素
canvas有多種繪制路徑、矩形、圓形、字符及添加圖像的方法
-->
<script type="text/javascript">
<!--
var canvas=document.getElementById('myCanvas');
var ctx=canvas.getContext('2d');
ctx.fillStyle='#FF0000';
ctx.fillRect(0,0,80,100);
//-->
</script>


ArcGIS API for JavaScript
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>ArcGIS API for JavaScript</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="http://js.arcgis.com/3.6/js/esri/css/esri.css">
<style>
html, body, #mapDiv {
padding: 0;
margin: 0;
height: 100%;
}
</style>
<script src="http://js.arcgis.com/3.6/"></script>
<script>
var map;
require(["esri/map", "dojo/domReady!"], function(Map) {
map = new Map("mapDiv", {
center: [111.324, 30.676],
zoom: 5,
basemap: "streets"
});
});
</script>
</head>
<body class="claro">
<div id="mapDiv"></div>
</body>
</html>

Copyright © Linux教程網 All Rights Reserved