主頁 > 前端設計 > 2021-08-20 JavaScript-1

2021-08-20 JavaScript-1

2021-08-23 10:22:39 前端設計

JavaScript

為什么要學習javascript

JS是屬于web的編程語言,html給出了web頁面的元素,css解決了web頁面元素的布局問題,想要實作web頁面的動態效果就需要使用JS,
使用JS可以有效地減輕服務器的壓力

JS特點

基于事件和物件驅動的安全的腳本語言
向html頁面添加互動行為
腳本語言,語法和Java類似
解釋型語言,邊執行邊解釋

JS基本結構

<script type="text/javascript">
/*以往的瀏覽器對于JS的支持并不友好,
*script標簽可以放在head標簽下也可以放在body標簽中,考慮到加載時間建議放到body標簽的底部
*你可以在標簽內部寫JavaScript陳述句
*看下面的例子舉一反三
*也可以給script標簽添加src屬性匯入外部JS
*/
window.document.write("value");
window.document.write("<p>value<p/>");
<script/>
<script type="text/javascript" src="js/index.jx "><script/>

JavaScript組成

<style>#mermaid-svg-C8EwCyFnSvai2FLn .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-C8EwCyFnSvai2FLn .label text{fill:#333}#mermaid-svg-C8EwCyFnSvai2FLn .node rect,#mermaid-svg-C8EwCyFnSvai2FLn .node circle,#mermaid-svg-C8EwCyFnSvai2FLn .node ellipse,#mermaid-svg-C8EwCyFnSvai2FLn .node polygon,#mermaid-svg-C8EwCyFnSvai2FLn .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-C8EwCyFnSvai2FLn .node .label{text-align:center;fill:#333}#mermaid-svg-C8EwCyFnSvai2FLn .node.clickable{cursor:pointer}#mermaid-svg-C8EwCyFnSvai2FLn .arrowheadPath{fill:#333}#mermaid-svg-C8EwCyFnSvai2FLn .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-C8EwCyFnSvai2FLn .flowchart-link{stroke:#333;fill:none}#mermaid-svg-C8EwCyFnSvai2FLn .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-C8EwCyFnSvai2FLn .edgeLabel rect{opacity:0.9}#mermaid-svg-C8EwCyFnSvai2FLn .edgeLabel span{color:#333}#mermaid-svg-C8EwCyFnSvai2FLn .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-C8EwCyFnSvai2FLn .cluster text{fill:#333}#mermaid-svg-C8EwCyFnSvai2FLn div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-C8EwCyFnSvai2FLn .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-C8EwCyFnSvai2FLn text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-C8EwCyFnSvai2FLn .actor-line{stroke:grey}#mermaid-svg-C8EwCyFnSvai2FLn .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-C8EwCyFnSvai2FLn .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-C8EwCyFnSvai2FLn #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-C8EwCyFnSvai2FLn .sequenceNumber{fill:#fff}#mermaid-svg-C8EwCyFnSvai2FLn #sequencenumber{fill:#333}#mermaid-svg-C8EwCyFnSvai2FLn #crosshead path{fill:#333;stroke:#333}#mermaid-svg-C8EwCyFnSvai2FLn .messageText{fill:#333;stroke:#333}#mermaid-svg-C8EwCyFnSvai2FLn .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-C8EwCyFnSvai2FLn .labelText,#mermaid-svg-C8EwCyFnSvai2FLn .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-C8EwCyFnSvai2FLn .loopText,#mermaid-svg-C8EwCyFnSvai2FLn .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-C8EwCyFnSvai2FLn .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-C8EwCyFnSvai2FLn .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-C8EwCyFnSvai2FLn .noteText,#mermaid-svg-C8EwCyFnSvai2FLn .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-C8EwCyFnSvai2FLn .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-C8EwCyFnSvai2FLn .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-C8EwCyFnSvai2FLn .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-C8EwCyFnSvai2FLn .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-C8EwCyFnSvai2FLn .section{stroke:none;opacity:0.2}#mermaid-svg-C8EwCyFnSvai2FLn .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-C8EwCyFnSvai2FLn .section2{fill:#fff400}#mermaid-svg-C8EwCyFnSvai2FLn .section1,#mermaid-svg-C8EwCyFnSvai2FLn .section3{fill:#fff;opacity:0.2}#mermaid-svg-C8EwCyFnSvai2FLn .sectionTitle0{fill:#333}#mermaid-svg-C8EwCyFnSvai2FLn .sectionTitle1{fill:#333}#mermaid-svg-C8EwCyFnSvai2FLn .sectionTitle2{fill:#333}#mermaid-svg-C8EwCyFnSvai2FLn .sectionTitle3{fill:#333}#mermaid-svg-C8EwCyFnSvai2FLn .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-C8EwCyFnSvai2FLn .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-C8EwCyFnSvai2FLn .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-C8EwCyFnSvai2FLn .grid path{stroke-width:0}#mermaid-svg-C8EwCyFnSvai2FLn .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-C8EwCyFnSvai2FLn .task{stroke-width:2}#mermaid-svg-C8EwCyFnSvai2FLn .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-C8EwCyFnSvai2FLn .taskText:not([font-size]){font-size:11px}#mermaid-svg-C8EwCyFnSvai2FLn .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-C8EwCyFnSvai2FLn .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-C8EwCyFnSvai2FLn .task.clickable{cursor:pointer}#mermaid-svg-C8EwCyFnSvai2FLn .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-C8EwCyFnSvai2FLn .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-C8EwCyFnSvai2FLn .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-C8EwCyFnSvai2FLn .taskText0,#mermaid-svg-C8EwCyFnSvai2FLn .taskText1,#mermaid-svg-C8EwCyFnSvai2FLn .taskText2,#mermaid-svg-C8EwCyFnSvai2FLn .taskText3{fill:#fff}#mermaid-svg-C8EwCyFnSvai2FLn .task0,#mermaid-svg-C8EwCyFnSvai2FLn .task1,#mermaid-svg-C8EwCyFnSvai2FLn .task2,#mermaid-svg-C8EwCyFnSvai2FLn .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-C8EwCyFnSvai2FLn .taskTextOutside0,#mermaid-svg-C8EwCyFnSvai2FLn .taskTextOutside2{fill:#000}#mermaid-svg-C8EwCyFnSvai2FLn .taskTextOutside1,#mermaid-svg-C8EwCyFnSvai2FLn .taskTextOutside3{fill:#000}#mermaid-svg-C8EwCyFnSvai2FLn .active0,#mermaid-svg-C8EwCyFnSvai2FLn .active1,#mermaid-svg-C8EwCyFnSvai2FLn .active2,#mermaid-svg-C8EwCyFnSvai2FLn .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-C8EwCyFnSvai2FLn .activeText0,#mermaid-svg-C8EwCyFnSvai2FLn .activeText1,#mermaid-svg-C8EwCyFnSvai2FLn .activeText2,#mermaid-svg-C8EwCyFnSvai2FLn .activeText3{fill:#000 !important}#mermaid-svg-C8EwCyFnSvai2FLn .done0,#mermaid-svg-C8EwCyFnSvai2FLn .done1,#mermaid-svg-C8EwCyFnSvai2FLn .done2,#mermaid-svg-C8EwCyFnSvai2FLn .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-C8EwCyFnSvai2FLn .doneText0,#mermaid-svg-C8EwCyFnSvai2FLn .doneText1,#mermaid-svg-C8EwCyFnSvai2FLn .doneText2,#mermaid-svg-C8EwCyFnSvai2FLn .doneText3{fill:#000 !important}#mermaid-svg-C8EwCyFnSvai2FLn .crit0,#mermaid-svg-C8EwCyFnSvai2FLn .crit1,#mermaid-svg-C8EwCyFnSvai2FLn .crit2,#mermaid-svg-C8EwCyFnSvai2FLn .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-C8EwCyFnSvai2FLn .activeCrit0,#mermaid-svg-C8EwCyFnSvai2FLn .activeCrit1,#mermaid-svg-C8EwCyFnSvai2FLn .activeCrit2,#mermaid-svg-C8EwCyFnSvai2FLn .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-C8EwCyFnSvai2FLn .doneCrit0,#mermaid-svg-C8EwCyFnSvai2FLn .doneCrit1,#mermaid-svg-C8EwCyFnSvai2FLn .doneCrit2,#mermaid-svg-C8EwCyFnSvai2FLn .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-C8EwCyFnSvai2FLn .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-C8EwCyFnSvai2FLn .milestoneText{font-style:italic}#mermaid-svg-C8EwCyFnSvai2FLn .doneCritText0,#mermaid-svg-C8EwCyFnSvai2FLn .doneCritText1,#mermaid-svg-C8EwCyFnSvai2FLn .doneCritText2,#mermaid-svg-C8EwCyFnSvai2FLn .doneCritText3{fill:#000 !important}#mermaid-svg-C8EwCyFnSvai2FLn .activeCritText0,#mermaid-svg-C8EwCyFnSvai2FLn .activeCritText1,#mermaid-svg-C8EwCyFnSvai2FLn .activeCritText2,#mermaid-svg-C8EwCyFnSvai2FLn .activeCritText3{fill:#000 !important}#mermaid-svg-C8EwCyFnSvai2FLn .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-C8EwCyFnSvai2FLn g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-C8EwCyFnSvai2FLn g.classGroup text .title{font-weight:bolder}#mermaid-svg-C8EwCyFnSvai2FLn g.clickable{cursor:pointer}#mermaid-svg-C8EwCyFnSvai2FLn g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-C8EwCyFnSvai2FLn g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-C8EwCyFnSvai2FLn .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-C8EwCyFnSvai2FLn .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-C8EwCyFnSvai2FLn .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-C8EwCyFnSvai2FLn .dashed-line{stroke-dasharray:3}#mermaid-svg-C8EwCyFnSvai2FLn #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-C8EwCyFnSvai2FLn #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-C8EwCyFnSvai2FLn #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-C8EwCyFnSvai2FLn #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-C8EwCyFnSvai2FLn #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-C8EwCyFnSvai2FLn #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-C8EwCyFnSvai2FLn #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-C8EwCyFnSvai2FLn #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-C8EwCyFnSvai2FLn .commit-id,#mermaid-svg-C8EwCyFnSvai2FLn .commit-msg,#mermaid-svg-C8EwCyFnSvai2FLn .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-C8EwCyFnSvai2FLn .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-C8EwCyFnSvai2FLn .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-C8EwCyFnSvai2FLn g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-C8EwCyFnSvai2FLn g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-C8EwCyFnSvai2FLn g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-C8EwCyFnSvai2FLn g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-C8EwCyFnSvai2FLn g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-C8EwCyFnSvai2FLn g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-C8EwCyFnSvai2FLn .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-C8EwCyFnSvai2FLn .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-C8EwCyFnSvai2FLn .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-C8EwCyFnSvai2FLn .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-C8EwCyFnSvai2FLn .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-C8EwCyFnSvai2FLn .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-C8EwCyFnSvai2FLn .edgeLabel text{fill:#333}#mermaid-svg-C8EwCyFnSvai2FLn .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-C8EwCyFnSvai2FLn .node circle.state-start{fill:black;stroke:black}#mermaid-svg-C8EwCyFnSvai2FLn .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-C8EwCyFnSvai2FLn #statediagram-barbEnd{fill:#9370db}#mermaid-svg-C8EwCyFnSvai2FLn .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-C8EwCyFnSvai2FLn .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-C8EwCyFnSvai2FLn .statediagram-state .divider{stroke:#9370db}#mermaid-svg-C8EwCyFnSvai2FLn .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-C8EwCyFnSvai2FLn .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-C8EwCyFnSvai2FLn .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-C8EwCyFnSvai2FLn .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-C8EwCyFnSvai2FLn .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-C8EwCyFnSvai2FLn .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-C8EwCyFnSvai2FLn .note-edge{stroke-dasharray:5}#mermaid-svg-C8EwCyFnSvai2FLn .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-C8EwCyFnSvai2FLn .error-icon{fill:#522}#mermaid-svg-C8EwCyFnSvai2FLn .error-text{fill:#522;stroke:#522}#mermaid-svg-C8EwCyFnSvai2FLn .edge-thickness-normal{stroke-width:2px}#mermaid-svg-C8EwCyFnSvai2FLn .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-C8EwCyFnSvai2FLn .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-C8EwCyFnSvai2FLn .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-C8EwCyFnSvai2FLn .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-C8EwCyFnSvai2FLn .marker{fill:#333}#mermaid-svg-C8EwCyFnSvai2FLn .marker.cross{stroke:#333} :root { --mermaid-font-family: "trebuchet ms", verdana, arial;}</style> <style>#mermaid-svg-C8EwCyFnSvai2FLn { color: rgba(0, 0, 0, 0.75); font: ; }</style>
JavaScript
ECMAScipt
DOM
BOM

JS原理

瀏覽器向服務器發送請求,服務器決議html和JS并回應瀏覽器發送資料

事件

  1. onclick 單擊事件
  2. onmouseover 滑鼠懸停事件
  3. onload 一個頁面或者一幅影像完成加載
  4. onkeydown 某個鍵盤中的鍵被按下
  5. onkeyup 鍵盤中的某個鍵回彈
  6. onpress 鍵盤中的按下并回彈
  7. onchange 域的內容被更改

JavaScript語法

變數 資料型別 陣列 運算子號 控制陳述句 注釋 輸入/輸出 語法約定

<script type="text/javascript">
//宣告變數
var name="value";
var num=6;
//typeof(var_name)用于獲取變數型別 
//資料型別 string number boolean undefined null object
//alert(引數)瀏覽器彈窗函式

//屬性 length 屬性和方法都是用"."符號和變數分割
//函式 indexOf() subString(index1,index2)左閉右開區間,
// split(str) str的值可以為"" or "," 將字串拆分為陣列以str中的符號間隔
var arrayName = new Array(7);//初始值為undefined型別
//join(str)  str的值為"-"或其他符號 將陣列轉換為字串用符號連接
//sort() 對陣列進行排序
//push() 向陣列新增元素并回傳新的長度
<script/>

運算子、邏輯控制(分支、回圈)
與Java語法上相似,不再贅述
break continue return
注釋

<script type="text/javascript">
//單行注釋
/*
*多行注釋
*/
<script/>

常用輸入輸出
alert(str);彈框提示
prompt(str1,str2);提示并獲取用戶輸入,獲取到的資訊都是string型別
語法約定
區分大小寫 識別符號 使用分號
除錯
進入開發者模式在瀏覽器中打斷點一步一步進行除錯

function函式

常用系統函式
parseInt(str) 字串轉換為數值型別 整數和小數
parseFloat(str)
isNaN() 非數值型別判斷
自定義函式

<script type="text/javascript">
function funName(num1,num2){
//在這里寫方法,引數串列中不需要識別符號var
//使用funName(實際引數串列)直接呼叫函式
}
<script/>

轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/295773.html

標籤:其他

上一篇:WebRTC會成主流嗎?P2P流媒體時代到了!

下一篇:記錄日常使用的Helper檔案

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • vue移動端上拉加載

    可能做得過于簡單或者比較low,請各位大佬留情,一起探討技術 ......

    uj5u.com 2020-09-10 04:38:07 more
  • 優美網站首頁,頂部多層導航

    一個個人用的瀏覽器首頁,可以把一下常用的網站放在這里,平常打開會比較方便。 第一步,HTML代碼 <script src=https://www.cnblogs.com/szharf/p/"js/jquery-3.4.1.min.js"></script> <div id="navigate"> <ul> <li class="labels labels_1"> ......

    uj5u.com 2020-09-10 04:38:47 more
  • 頁面為要加<!DOCTYPE html>

    最近因為寫一個js函式,需要用到$(window).height(); 由于手寫demo的時候,過于自信,其實對前端方面的認識也不夠體系,用文本檔案直接敲出來的html代碼,第一行沒有加上<!DOCTYPE html> 導致了$(window).height();的結果直接是整個document的高 ......

    uj5u.com 2020-09-10 04:38:52 more
  • WordPress網站程式手動升級要做好資料備份

    WordPress博客網站程式在進行升級前,必須要做好網站資料的備份,這個問題良家佐言是遇見過的;在剛開始接觸WordPress博客程式的時候,因為升級問題和博客網站的修改的一些嘗試,良家佐言是吃盡了苦頭。因為購買的是西部數碼的空間和域名,每當佐言把自己的WordPress博客網站搞到一塌糊涂的時候 ......

    uj5u.com 2020-09-10 04:39:30 more
  • WordPress程式不能升級為5.4.2版本的原因

    WordPress是一款個人博客系統,受到英文博客愛好者和中文博客愛好者的追捧,并逐步演化成一款內容管理系統軟體;它是使用PHP語言和MySQL資料庫開發的,用戶可以在支持PHP和MySQL資料庫的服務器上使用自己的博客。每一次WordPress程式的更新,就會牽動無數WordPress愛好者的心, ......

    uj5u.com 2020-09-10 04:39:49 more
  • 使用CSS3的偽元素進行首字母下沉和首行改變樣式

    網頁中常見的一種效果,首字改變樣式或者首行改變樣式,效果如下圖。 代碼: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, ......

    uj5u.com 2020-09-10 04:40:09 more
  • 關于a標簽的講解

    什么是a標簽? <a> 標簽定義超鏈接,用于從一個頁面鏈接到另一個頁面。 <a> 元素最重要的屬性是 href 屬性,它指定鏈接的目標。 a標簽的語法格式:<a href=https://www.cnblogs.com/summerxbc/p/"指定要跳轉的目標界面的鏈接">需要展示給用戶看見的內容</a> a標簽 在所有瀏覽器中,鏈接的默認外觀如下: 未被訪問的鏈接帶 ......

    uj5u.com 2020-09-10 04:40:11 more
  • 前端輪播圖

    在需要輪播的頁面是引入swiper.min.js和swiper.min.css swiper.min.js地址: 鏈接:https://pan.baidu.com/s/15Uh516YHa4CV3X-RyjEIWw 提取碼:4aks swiper.min.css地址 鏈接:https://pan.b ......

    uj5u.com 2020-09-10 04:40:13 more
  • 如何設定html中的背景圖片(全屏顯示,且不拉伸)

    1 <style>2 body{background-image:url(https://uploadbeta.com/api/pictures/random/?key=BingEverydayWallpaperPicture); 3 background-size:cover;background ......

    uj5u.com 2020-09-10 04:40:16 more
  • Java學習——HTML詳解(上)

    HTML詳解 初識HTML Hyper Text Markup Language(超文本標記語言) 1 <!--DOCTYPE:告訴瀏覽器我們要使用什么規范--> 2 <!DOCTYPE html> 3 <html lang="en"> 4 <head> 5 <!--meta 描述性的標簽,描述一些 ......

    uj5u.com 2020-09-10 04:40:33 more
最新发布
  • 我的第一個NPM包:panghu-planebattle-esm(胖虎飛機大戰)使用說明

    好家伙,我的包終于開發完啦 歡迎使用胖虎的飛機大戰包!! 為你的主頁添加色彩 這是一個有趣的網頁小游戲包,使用canvas和js開發 使用ES6模塊化開發 效果圖如下: (覺得圖片太sb的可以自己改) 代碼已開源!! Git: https://gitee.com/tang-and-han-dynas ......

    uj5u.com 2023-04-20 07:59:23 more
  • 生產事故-走近科學之消失的JWT

    入職多年,面對生產環境,盡管都是小心翼翼,慎之又慎,還是難免捅出簍子。輕則滿頭大汗,面紅耳赤。重則系統停擺,損失資金。每一個生產事故的背后,都是寶貴的經驗和教訓,都是專案成員的血淚史。為了更好地防范和遏制今后的各類事故,特開此專題,長期更新和記錄大大小小的各類事故。有些是親身經歷,有些是經人耳傳口授 ......

    uj5u.com 2023-04-18 07:55:04 more
  • 記錄--Canvas實作打飛字游戲

    這里給大家分享我在網上總結出來的一些知識,希望對大家有所幫助 打開游戲界面,看到一個畫面簡潔、卻又富有挑戰性的游戲。螢屏上,有一個白色的矩形框,里面不斷下落著各種單詞,而我需要迅速地輸入這些單詞。如果我輸入的單詞與螢屏上的單詞匹配,那么我就可以獲得得分;如果我輸入的單詞錯誤或者時間過長,那么我就會輸 ......

    uj5u.com 2023-04-04 08:35:30 more
  • 了解 HTTP 看這一篇就夠

    在學習網路之前,了解它的歷史能夠幫助我們明白為何它會發展為如今這個樣子,引發探究網路的興趣。下面的這張圖片就展示了“互聯網”誕生至今的發展歷程。 ......

    uj5u.com 2023-03-16 11:00:15 more
  • 藍牙-低功耗中心設備

    //11.開啟藍牙配接器 openBluetoothAdapter //21.開始搜索藍牙設備 startBluetoothDevicesDiscovery //31.開啟監聽搜索藍牙設備 onBluetoothDeviceFound //30.停止監聽搜索藍牙設備 offBluetoothDevi ......

    uj5u.com 2023-03-15 09:06:45 more
  • canvas畫板(滑鼠和觸摸)

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>canves</title> <style> #canvas { cursor:url(../images/pen.png),crosshair; } #canvasdiv{ bo ......

    uj5u.com 2023-02-15 08:56:31 more
  • 手機端H5 實作自定義拍照界面

    手機端 H5 實作自定義拍照界面也可以使用 MediaDevices API 和 <video> 標簽來實作,和在桌面端做法基本一致。 首先,使用 MediaDevices.getUserMedia() 方法獲取攝像頭媒體流,并將其傳遞給 <video> 標簽進行渲染。 接著,使用 HTML 的 < ......

    uj5u.com 2023-01-12 07:58:22 more
  • 記錄--短視頻滑動播放在 H5 下的實作

    這里給大家分享我在網上總結出來的一些知識,希望對大家有所幫助 短視頻已經無數不在了,但是主體還是使用 app 來承載的。本文講述 H5 如何實作 app 的視頻滑動體驗。 無聲勝有聲,一圖頂百辯,且看下圖: 網址鏈接(需在微信或者手Q中瀏覽) 從上圖可以看到,我們主要實作的功能也是本文要講解的有: ......

    uj5u.com 2023-01-04 07:29:05 more
  • 一文讀懂 HTTP/1 HTTP/2 HTTP/3

    從 1989 年萬維網(www)誕生,HTTP(HyperText Transfer Protocol)經歷了眾多版本迭代,WebSocket 也在期間萌芽。1991 年 HTTP0.9 被發明。1996 年出現了 HTTP1.0。2015 年 HTTP2 正式發布。2020 年 HTTP3 或能正... ......

    uj5u.com 2022-12-24 06:56:02 more
  • 【HTML基礎篇002】HTML之form表單超詳解

    ??一、form表單是什么

    ??二、form表單的屬性

    ??三、input中的各種Type屬性值

    ??四、標簽 ......

    uj5u.com 2022-12-18 07:17:06 more