页面内查找
发布时间:2023-07-02 05:25:46
标签:页面内查找
你可以输入'脚本'查查看 查找页面中的字符 <script language="JavaScript"> var NS4 = (document.layers); // Which browser? var IE4 = (document.all); var win = window; // window to search. var n = 0; function findInPage(str) { var txt, i, found; if (str == "") return false; // Find next occurance of the given string on the page, wrap around to the // start of the page if necessary. if (NS4) { // Look for match starting at the current point. If not found, rewind // back to the first match. if (!win.find(str)) while(win.find(str, false, true)) n++; else n++; // If not found in either direction, give message. if (n == 0) alert("Not found."); } if (IE4) { txt = win.document.body.createTextRange(); // Find the nth match from the top of the page. for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) { txt.moveStart("character", 1); txt.moveEnd("textedit"); } // If found, mark it and scroll it into view. if (found) { txt.moveStart("character", -1); txt.findText(str); txt.select(); txt.scrollIntoView(); n++; } // Otherwise, start over at the top of the page and find first match. else { if (n > 0) { n = 0; findInPage(str); } // Not found anywhere, give message. else alert("Not found."); } } return false; } </script> <form name="search" onSubmit="return findInPage(this.string.value);"> <font size=3><input name="string" type="text" size=15 onChange="n = 0;"></font> <input type="submit" value="Find"> </form>
0
投稿
猜你喜欢
- 概述:前段时间在跟其他公司DBA交流时谈到了mysql跟PG之间在多表关联查询上的一些区别,相比之下mysql只有一种表连接类型:嵌套循环连
- 本文主要介绍如何用Python设计一个经典小游戏:猜大小。在这个游戏中,将用到前面我介绍过的所有内容:变量的使用、参数传递、函数设计、条件控
- 1、SQL SERVER 2005的性能工具中有SQL Server Profiler和数据库引擎优化顾问,极好的东东,必须熟练使用。 2、
- 在 Facebook 上有一个彩蛋:登录 facebook.com ,点击你首页的任何地方,键盘输入 Up, Up, Down, Down,
- 现在的域名提供已经取消免费的url转发功能,而且我们一般主要用的是带www的域名,以前不带www的域名一般是做url转发跳转到带www的域名
- 天气真的是越来越冷啦,有时候我们想翻看网页新闻,但是又冷的不想把手拿出来,移动鼠标翻看。这时候,是不是特别想电脑像讲故事一样,给我们念出来呢
- 元组的特点:是一种不可变序列,一旦创建就不能修改1、拆包将元组的元素取出赋值给不同变量>>> a = ('hell
- 先来看查看效果:在代码连接数据库后,并且执行三条sql后,将mysql直接重启掉,故我们的连接池连接均是不ok的,所以,它会全部删除再抓新的
- 需求分析根据原始数据,计算出累计和、回撤、连续正确、连续错误、连续正确值与连续错误值6项数据,其中原始数据大于等于0认定为正确,原始数据小于
- 本文实例讲述了Flask框架请求钩子与request请求对象。分享给大家供大家参考,具体如下:请求钩子在客户端和服务器交互的过程中,有些准备
- 首先centos7 已经不支持mysql,因为收费了你懂得,所以内部集成了mariadb,而安装mysql的话会和mariadb的文件冲突,
- 1.建立设计规范的意义 建立设计文档的根本目的
- pytorch中的权值初始化官方论坛对weight-initilzation的讨论torch.nn.Module.apply(fn)torc
- 看Python简明教程,学习使用print打印字符串,试了下打印中文,不行。编辑环境:IDLE上网搜了下解决办法,各种说法,试了两种:pri
- 前言gif图就是动态图,它的原理和视频有点类似,也是通过很多静态图片合成的.本篇文章主要介绍,如何利用Python快速合成gif图,主要利用
- 记得以前写过一篇文章 php有效的过滤html标签,js代码,css样式标签: <?php $str = preg_replace(
- Python的装饰器可以实现在代码运行期间修改函数的上下文, 即可以定义函数在执行之前进行何种操作和函数执行后进行何种操作, 而函数本身并没
- XPath(XML Path language)是一种处理XML文档段的语言。XSLT(Extensible Stylesheet Lang
- 一、流程分析:1.用户在项目前端,输入手机号,然后点击【获取验证码】,将手机号发到post到后台。2.后台验证手机号是否合法,是否已被占用,
- python 3.x版本print输出不换行的格式如下:print(x, end="")其中,end=&quo