我的操做習慣
-----HTML-----
<!DOCTYPE HTML>
<html>
<head>
<!--申明當前頁面的編碼集-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--網頁標題-->
<title>HTML5移動端開發模板</title>
<!--網頁關鍵詞-->
<meta name="keywords" content="" />
<!--網頁描述-->
<meta name="description" content="" />
<!--適配當前屏幕-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<!--禁止自動識別電話號碼-->
<meta name="format-detection" content="telephone=no" />
<!--禁止自動識別郵箱-->
<meta content="email=no" name="format-detection" />
<!--iphone中safari私有meta標籤, 容許全屏模式瀏覽,隱藏瀏覽器導航欄-->
<meta name="apple-mobile-web-app-capable" content="yes" />
<!--iphone中safari頂端的狀態條的樣式black(黑色)-->
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<style type="text/css"> /*reset 重置*/ body,ul,ol,p,h1,h2,h3,h4,h5,dl,dd,form,input,textarea, td,th,button,strong,em,select,video,canvas{margin:0;padding:0;} li{list-style:none;vertical-align:top;} table{ border-collapse:collapse;} textarea{resize:none;overflow:auto;} img{ border:none; vertical-align:middle;} em{ font-style:normal;} a{ text-decoration:none;} a,input{ -webkit-appearance: none;/*屏蔽陰影*/ -webkit-tap-highlight-color:rgba(0,0,0,0); /*ios android去除自帶陰影的樣式*/ } a, img { /* 禁止長按連接與圖片彈出菜單 */ -webkit-touch-callout: none; } html, body { /* 禁止選中文本(如無文本選中需求,此爲必選項) */ -webkit-user-select: none; user-select: none; } /*public*/ html { font-size : 20px; } @media only screen and (min-width: 401px){ html { font-size: 25px !important; } } @media only screen and (min-width: 428px){ html { font-size: 26.75px !important; } } @media only screen and (min-width: 481px){ html { font-size: 30px !important; } } @media only screen and (min-width: 569px){ html { font-size: 35px !important; } } @media only screen and (min-width: 641px){ html { font-size: 40px !important; } } body{font-family: "Helvetica Neue", Helvetica, "STHeiTi", sans-serif; overflow-x:hidden; overflow-y:auto; font-size:0.7rem; } .clear{zoom:1;} .clear:after{content:''; display:block; clear:both;} .fl{float:left;} .fr{float:right;} .viewport{ max-width:640px; margin:0 auto; overflow-x:hidden;} </style>
</head>
<body>
<div>
<div>這是一個移動端開發模板喲!</div>
</div>
</body>
</html>複製代碼
width:複製代碼
height:複製代碼
scrijavascript
<script type='text/javascript' src='' charset='utf-8'></script>複製代碼
<style></style>複製代碼
-----CSS-----
margin-left:複製代碼
margin-right:複製代碼
background-color:
複製代碼
@media only screen and (min-width: ) {
}複製代碼
-----JavaScript-----
console.log("");複製代碼
if(){
}複製代碼
$("").複製代碼
document.getElementById('')複製代碼
$.ajax({
url:'',
type:'POST', //GET
async:true, //false
data:{
name:'joking',
age:21
},
timeout:5000, //超時時間
dataType:'json', //返回的數據格式:json/xml/html/script/jsonp/text
beforeSend:function(xhr){
console.log(xhr)
console.log('發送前') },
success:function(data,textStatus,jqXHR){
console.log(data);
},
error:function(xhr,textStatus){
console.log('錯誤',xhr.responseText);
console.log(xhr);
console.log(textStatus);
}
}) 複製代碼
window.sessionStorage.getItem("");複製代碼
window.sessionStorage.setItem("","");複製代碼
window.location.href = ".html";複製代碼
-----PHP-----
var_dump();複製代碼
用戶代碼片斷->html.jsonphp
{
"Html": {
"prefix": "html",
"body": [
"<!DOCTYPE html>",
"<html lang=\"zh-CN\">",
"<head>",
"\t<meta charset=\"UTF-8\">",
"\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
"\t<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
"\t<title>Document</title>",
"</head>\n",
"<body>",
"</body>",
"</html>"
],
"description": "快速建立在html5模板"
},
"vue-html":{
"prefix": "vue",
"body": [
"<!DOCTYPE html>",
"<html lang=\"zh-CN\">",
"<head>",
"\t<meta charset=\"UTF-8\">",
"\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
"\t<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
"\t<title>Document</title>",
"</head>\n",
"<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue\"><\/script>",
"<body>",
"<div id='joking'>\n",
"</div>",
"</body>",
"<script>",
"new Vue({",
"\tel: '#joking',",
"\tdata: {\n",
"\t},",
"\tmethods: {\n",
"\t},",
"})",
"<\/script>",
"</html>" ],
"description": "快速建立在html-vue模板" },
"ajax": {
"prefix": "ajax",
"body": [
"$.ajax({",
"\turl:'',",
"\ttype:'POST',",
"\t\tasync:true,",
"\t\tdata:{",
"\t\t},",
"\ttimeout:5000,",
"\tdataType:'json',",
"\tbeforeSend:function(xhr){\n",
"\t},",
"\tsuccess:function(data){",
"\t\tconsole.log(data)",
"\t},",
"\terror:function(xhr,textStatus){\n",
"\t}",
"})"
],
"description": "基於jquery的Ajax模板" },}
複製代碼