Jekyll 报错 cannot load such file — webrick 问题: 执行 bundle exec jekyll serve 1 bundle exec jekyll serve 报错 [crayon-670a… Read More
aliyun OSS 中的css 报错 *.font cors blocked 问题: html 中引用了 aliyun oss 中的 css , 浏览时有些图标出不来,看浏览器 cons… Read More
ES2015 Promise demo 解决: <!DOCTYPE html> <html> <head> <script> let i = true; function get() { const p = new Promise((resolve, reject) => { if (i) { resolve("ok"); } else { reject("error"); } i = !i; }); return p; } function onRefresh() { const p = get(); let resultDiv = document.getElementById("result"); let errorDiv = document.getElementById("error"); p.then(v => { resultDiv.innerText = v; errorDiv.innerText = null; }).catch(err => { resultDiv.innerText = null; errorDiv.innerText = err; }); } </script> </head> <body> <div id="result"></div> <div id="error"></div> <button onclick="onRefresh()">刷新</button> </body> </html> 123456789101112131415161718192021222324252627282930313233343536 <!DOCTYPE html><html> <head> <script> let i = true; function get() { const p = new Promise((resolve, reject) => { if (i) { resolve("ok"); } else { reject("error"); } i = !i; }); return p; } function onRefresh() { const p = get(); let resultDiv = document.getElementById("result"); let errorDiv = document.getElementById("error"); p.then(v => { resultDiv.innerText = v; errorDiv.innerText = null; }).catch(err => { resultDiv.innerText = null; errorDiv.innerText = err; }); } </script> </head> <body> <div id="result"></div> <div id="error"></div> <button onclick="onRefresh()">刷新</button> </body></html> &nbs… Read More
html5 canvas demo 解决: <!doctype <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>tt</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <script> function draw(){ var c = document.getElementById('c'); var ctx = c.getContext('2d'); ctx.fillStyle="rgb(200,0,0)" ctx.fillRect(100,100,150,150); ctx.fillStyle="rgba(0,0,200,0.5)"; ctx.fillRect(150,150,200,200); } function getCtx(){ var c = document.getElementById('c'); var ctx = c.getContext('2d'); return ctx; } function drawPath(){ var ctx = getCtx(); ctx.beginPath(); ctx.moveTo(50,50); ctx.lineTo(50,100); ctx.lineTo(100,100); ctx.stroke(); } function drawFace(){ var c = getCtx(); c.beginPath(); c.arc(75,75,50,0,Math.PI*2,true); c.moveTo(110,75); c.arc(75,75,35,0,Math.PI); c.stroke(); } function drawSVGPath(){ var c= getCtx(); c.strokeStyle="#ff0000"; var p = new Path2D("M10 10 h 80 v 80 h -80 Z"); c.stroke(p); } function drawText(){ var c = getCtx(); c.font = "50px serif"; c.fillStyle = "#00FF00"; c.strokeText("你好",100,100); } </script> </head> <body onload="drawText()"> <canvas id="c" width="500" height="500" /> </body> </html> 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 <!doctype <!DOCTYPE html><html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>tt</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <script> function draw(){ var c = document.getElementById('c'); var ctx = c.getContext('2d'); ctx.fillStyle="rgb(200,0,0)" ctx.fillRect(100,100,150,150); ctx.fillStyle="rgba(0,0,200,0.5)"; ctx.fillRect(150,150,200,200); } function getCtx(){ var c = document.getElementById('c'); var ctx = c.getContext('2d'); return ctx; } function drawPath(){ var ctx = getCtx(); ctx.beginPath(); ctx.moveTo(50,50); ctx.lineTo(50,100); ctx.lineTo(100,100); ctx.stroke(); } function drawFace(){ var c = getCtx(); c.beginPath(); c.arc(75,75,50,0,Math.PI*2,true); c.moveTo(110,75); c.arc(75,75,35,0,Math.PI); c.stroke(); } function drawSVGPath(){ var c= getCtx(); c.strokeStyle="#ff0000"; var p = new Path2D("M10 10 h 80 v 80 h -80 Z"); c.stroke(p); } function drawText(){ var c = getCtx(); c.font = "50px serif"; c.fillStyle = "#00FF00"; c.strokeText("你好",100,100); } </script></head> <body onload="drawText()"> <canvas id="c" width="500" height="500" /></body> </html> &nbs… Read More
【转】CORS跨域时axios无法获取服务器自定义的header信息 https://blog.csdn.net/adsadadaddadasda/article/details/… Read More
【转】vue-cli+webpack在生成的项目中使用bootstrap方法(二) 转: https://www.cnblogs.com/kongxianghai/p/6910133.html … Read More