Js实现 clrt+f JavaScript
<script type="text/javascript">
var DOM = (document.getElementById) ? 1 : 0;
var NS4 = (document.layers) ? 1 : 0;
var IE4 = 0; if (document.all) { IE4 = 1; DOM = 0; }
var win = window;
var n = 0;
function findIt() {
if (document.getElementById("searchstr").value != "")
findInPage(document.getElementById("searchstr").value);
}
function findInPage(str) {
var txt, i, found;
if (str == "")
return false;
if (DOM) {
win.find(str, false, true);
return true;
}
if (NS4) {
if (!win.find(str))
while (win.find(str, false, true))
n++;
else
n++;
if (n == 0)
alert("未找到指定内容.");
}
if (IE4) {
txt = win.document.body.createTextRange();
for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
txt.moveStart("character", 1);
txt.moveEnd("textedit");
}
if (found) {
txt.moveStart("character", -1);
txt.findText(str);
txt.select();
txt.scrollIntoView();
n++;
} else {
if (n > 0) {
n = 0;
findInPage(str);
} else
alert("未找到指定内容.");
}
}
return false;
}
</script>
<input type="text" class="edit_seachrTxt" id="searchstr" name="searchstr" />
<label class="lableBtn"><input type="button" class="edit_seachrBtn" value="查找并选择" onclick="javascript:findIt()" /></label>
uniapp,常用工具函数 APP
在移动应用开发中,数据缓存是非常重要的一环。uni.getstorage作为uni-app的内置缓存API,提供了非常方便的数据存储能力。本篇文章将由以下几个方面进行详细的阐述,包括uni.getStorageSync, uni.getStorageInfoSync, uni.getStorageInfo, uni.getStorageSync缓存问题,旨在帮助读者深入了解uni.getstorage的使用和注意事项。
WIN10企业版LTSC如何激活 DEMO
WIN10企业版LTSC如何激活?win10企业版ltsc又被称为win10企业版2019长期服务版本,下文中为大家带来了win10企业版ltsc激活密钥及使用密钥教程,小编亲测有效,感兴趣的朋友不妨阅读下文内容,参考一下吧
标签: 实例
js过滤HTML标签完整实例 DEMO
这篇文章主要介绍了js过滤HTML标签实现方法,以完整实例形式分析了JavaScript使用正则表达式过滤HTML标签的相关技巧,具有一定参考借鉴价值,需要的朋友可以参考下
js实现页面打开自动定位到指定元素位置 JavaScript
类似页面抛点
<div class="more-merchant" id="moreMerchant"></div>
document.getElementById("moreMerchant").scrollIntoView()
标签: 实例
js获取UA(user-agent) JavaScript
<!DOCtype html> <html> <head> <title></title> </head> <body onload="whatBrowser()"> <script> function whatBrowser() { document.Browser.Name.value=navigator.appName; document.Browser.Version.value=navigator.appVersion; document.Browser.Code.value=navigator.appCodeName; document.Browser.Agent.value=navigator.userAgent; } </script> <table> <form name="Browser"> <tr> <td> 浏览器名称: </td> <td> <input type="txt" name="Name" size="110%"></td> </tr> <tr> <td> 版本号:</td> <td> <input type="txt" name="Version" size="110%"></td> </tr> <tr> <td> 代码名称: </td> <td> <input type="txt" name="Code" size="110%"></td> </tr> <tr> <td> 用户代理标识:</td> <td> <input type="txt" name="Agent" size="110%"></td> </tr> </form> </table> </body> </html>
标签: 实例
js判断是否安卓设备 JavaScript
var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; if(isAndroid){ alert("是安卓"); }
linux下如何使用vnstat查看服务器带宽流量统计 DEMO
因为很多vps或者服务器都是限流量的,但是又很多服务商并没有提供详细的流量表,比如每天的流量表,所以肯定有人很想知道自己服务器到底跑了多少流量。
标签: 实例