递归出题
This commit is contained in:
61
teaching/jwl/课件/js/apitest.html
Normal file
61
teaching/jwl/课件/js/apitest.html
Normal file
@@ -0,0 +1,61 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
用户名<input type="text" value="" id="account">
|
||||
</div>
|
||||
<div>
|
||||
密码 <input type="password" value="" id="pwd">
|
||||
</div>
|
||||
<button onclick="login()">登录</button>
|
||||
|
||||
<div>
|
||||
<table>
|
||||
<tr id="userlist">
|
||||
<th>用户编号</th>
|
||||
<th>用户名</th>
|
||||
<th>用户账号</th>
|
||||
<th>用户密码</th>
|
||||
<th>邮箱</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<script>
|
||||
$.ajax({
|
||||
url:"http://127.0.0.1:5000/userlist",
|
||||
success:function(res){
|
||||
// console.log(res)
|
||||
var ulist=JSON.parse(res)
|
||||
console.log(ulist)
|
||||
for(let i=0;i<ulist["data"].length;i++){
|
||||
$("table").append("<tr><td>"+ulist["data"][i].userid+"</td> <td>"+ulist["data"][i].username+"</td> <td>asd</td> <td>123</td><td>a@</td></tr>")
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
function login(){
|
||||
console.log("aaaaaa")
|
||||
var data={account:$("#account").val(),pwd:$("#pwd").val()}
|
||||
$.ajax({
|
||||
url:"http://127.0.0.1:5000/login",
|
||||
type:"post",
|
||||
data:data,
|
||||
dataType:"json",
|
||||
success:function(res){
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
55
teaching/jwl/课件/js/bibao.html
Normal file
55
teaching/jwl/课件/js/bibao.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<script>
|
||||
function f1() {
|
||||
var n = 999;
|
||||
// console.log(n)
|
||||
function f11() {
|
||||
console.log(n)
|
||||
}
|
||||
// f11()
|
||||
return f11
|
||||
}
|
||||
|
||||
var f2 = f1(); // =>f11
|
||||
f2()
|
||||
// 函数在没有return 语句或者是return 后面为空的时候, 函数的返回值等于undefined
|
||||
// 如果return 后面不为空的话 那么函数的返回值 即等于 return后面的东西
|
||||
|
||||
// console.log(f2)
|
||||
|
||||
|
||||
|
||||
var name = "The Window";
|
||||
|
||||
var object = {
|
||||
name: "My Object",
|
||||
|
||||
getNameFunc: function () {
|
||||
var that = this;
|
||||
return function () {
|
||||
return that.name;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
alert(object.getNameFunc()());
|
||||
|
||||
var func=object.getNameFunc()
|
||||
func()
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
26
teaching/jwl/课件/js/bom.html
Normal file
26
teaching/jwl/课件/js/bom.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<script>
|
||||
var obj={
|
||||
name:"张三",
|
||||
nickname:"法外之鱼"
|
||||
}
|
||||
|
||||
var jsonobj={
|
||||
"name":"a",
|
||||
"nickname":"b"
|
||||
}
|
||||
|
||||
// JSON.stringfy() 把对象转成json
|
||||
// JSON.parse() 把json转成对象
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
45
teaching/jwl/课件/js/digui.html
Normal file
45
teaching/jwl/课件/js/digui.html
Normal file
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<script>
|
||||
function jiecheng(n){
|
||||
if(n==1){
|
||||
return 1
|
||||
}else{
|
||||
console.log(arguments.callee)
|
||||
return n*arguments.callee(n-1)
|
||||
// 5*5-1 5*4
|
||||
// 5*4*3
|
||||
// 5*4*3*2
|
||||
// 5*4*3*2*1
|
||||
|
||||
}
|
||||
}
|
||||
// 5*4*3*2*1
|
||||
// function jc(n){
|
||||
// if(n==1){
|
||||
// return 1
|
||||
// }else{
|
||||
// return n*a(n-1)
|
||||
// // 5*5-1 5*4
|
||||
// // 5*4*3
|
||||
// // 5*4*3*2
|
||||
// // 5*4*3*2*1
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
var jc=jiecheng
|
||||
jiecheng=null
|
||||
var sum=jc(5) //120
|
||||
console.log(sum)
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
43
teaching/jwl/课件/js/dingshiqi.html
Normal file
43
teaching/jwl/课件/js/dingshiqi.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<script>
|
||||
// 定时器 setinterval(多长时间后自动执行) settimeout(延迟多久执行)
|
||||
// var time= setInterval(() => {
|
||||
// var now= new Date()
|
||||
// console.log(now)
|
||||
// console.log(now.getFullYear()+'/'+parseInt(now.getMonth()+1)+'/'+now.getDate())
|
||||
// // getmonth() 取到的值是当前月份的前一天
|
||||
// // getday 周几
|
||||
// console.log(now.getHours()+':'+now.getMinutes()+':'+now.getSeconds())
|
||||
// }, 1000);
|
||||
// function stop(){
|
||||
// clearInterval(time)
|
||||
// }
|
||||
|
||||
// function yanchi(){
|
||||
// var yc=setTimeout(function(){
|
||||
// alert("hello world")
|
||||
// },3000)
|
||||
// // clearTimeout(yc)
|
||||
// }
|
||||
|
||||
// 日期时间
|
||||
// var now= new Date()
|
||||
// console.log(now)
|
||||
// console.log(now.getFullYear()+'/'+parseInt(now.getMonth()+1)+'/'+now.getDate())
|
||||
// // getmonth() 取到的值是当前月份的前一天
|
||||
// // getday 周几
|
||||
// console.log(now.getHours()+':'+now.getMinutes()+':'+now.getSeconds())
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<button onclick="stop()">stop</button>
|
||||
<button onclick="yanchi()">yanchi</button>
|
||||
</body>
|
||||
</html>
|
||||
63
teaching/jwl/课件/js/localstorage.html
Normal file
63
teaching/jwl/课件/js/localstorage.html
Normal file
@@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
|
||||
<script>
|
||||
// localstorage
|
||||
localStorage.setItem("pwd","123") //添加
|
||||
localStorage.setItem("id","90")
|
||||
let pwd=localStorage.getItem("pwd") //获取
|
||||
// localStorage.removeItem("id") //删除指定
|
||||
localStorage.clear() //删除所有
|
||||
console.log(pwd)
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
文本框<input type="text" value="" id="text"><br>
|
||||
密码框<input type="password" value="" id="pwd"><br>
|
||||
单选框<input type="radio" name="char" value="a">A<input type="radio" name="char" value="b">B<input type="radio" name="char" value="c">C<br>
|
||||
复选框<input type="checkbox" value="1" checked>111<input type="checkbox" value="2" checked>222<input type="checkbox" value="3" checked>333 <br>
|
||||
下拉列表<select name="" id="xia">
|
||||
<option value="1">选项一</option>
|
||||
<option value="2">选项二</option>
|
||||
<option value="3">选项三</option>
|
||||
</select>
|
||||
<button id="sub">获取</button>
|
||||
<p>aaaassxsxs</p>
|
||||
<script>
|
||||
$("#sub").click(function(){
|
||||
var checkedarr=[]
|
||||
// console.log($("#text").val())
|
||||
// console.log($("#pwd").val())
|
||||
// var dan=$("input[type='radio']:checked").val()
|
||||
// console.log(dan)
|
||||
var fu=$("input[type='checkbox']")
|
||||
fu.each(function(){
|
||||
console.log($(this).prop('checked'))
|
||||
checkedarr.push($(this).prop('checked'))
|
||||
})
|
||||
console.log(checkedarr)
|
||||
|
||||
// var xia=$("#xia option:selected").val()
|
||||
// console.log(xia)
|
||||
// $("p").append("Some appended text.");
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
$.ajax({
|
||||
url:"https://kaoshi-shangpin.theluyuan.com/findshop", //地址
|
||||
|
||||
success:function(res){
|
||||
console.log(res)
|
||||
} //接收返回值
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user