更改在包河接口数据
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>搜索引擎</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="search">
|
||||
<select id="menu" >
|
||||
<option value="null">--请选择--</option>
|
||||
<option value="https://www.baidu.com/s?wd=">百度搜索</option>
|
||||
<option value="https://www.so.com/s?q=">360搜索</option>
|
||||
<option value="https://www.sogou.com/web?query=">搜狗搜索</option>
|
||||
</select>
|
||||
|
||||
|
||||
<input type="text" placeholder="请输入要检索的内容" id="keyword">
|
||||
|
||||
<button onclick="Search()">搜索</button>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
function Search() {
|
||||
|
||||
var key = document.getElementById("keyword")
|
||||
var sou = document.getElementById("menu")
|
||||
|
||||
if (sou.selectedIndex === 0 || key.value.length === 0) {
|
||||
alert("请检查是否选择搜索引擎和输入关键词")
|
||||
}else {
|
||||
open(sou.options[sou.selectedIndex].value+key.value)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,31 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
// 函数 function
|
||||
// 作用: 将完成相同任务或逻辑计算的代码放在一起,
|
||||
// 好处: 降低代码冗余和重复,提高代码的可读性逻辑性
|
||||
// 注意: 函数定义后 一定要调用才是被程序运行
|
||||
// 语法:
|
||||
|
||||
// function getName() {
|
||||
// console.log(arguments)
|
||||
// return "我是 ";
|
||||
// }
|
||||
|
||||
// var data = getName('zhangsan',45,67,9898);
|
||||
// console.log(data)
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,55 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>留言字数限制检测</title>
|
||||
<style>
|
||||
.main {
|
||||
width: 500px;
|
||||
height: 306px;
|
||||
border: 1px solid #e3e3e3;
|
||||
position: relative;
|
||||
}
|
||||
.main span {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
bottom: 5px;
|
||||
}
|
||||
textarea {
|
||||
outline:none;
|
||||
resize:none;
|
||||
}
|
||||
.error {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<div class="main">
|
||||
<textarea name="" oninput="texts()" id="mess" cols="80" rows="20"></textarea>
|
||||
<span id="shengyu">剩余字数 10/10</span>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var total = 10;
|
||||
function texts () {
|
||||
var tips = document.getElementById("shengyu");
|
||||
var Message = document.getElementById("mess").value
|
||||
if( (total - Message.length) <= 0){
|
||||
tips.innerHTML= "剩余字数 <b class='error'>0</b>/10"
|
||||
document.getElementById("mess").value = Message.substring(0,10)
|
||||
}else {
|
||||
tips.innerHTML= "剩余字数 " + ((total - Message.length).toString()) + "/10"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user