<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Find and Replace Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<script>
<!--
var iFlag;
function search() {
var wPopupElements=wPopup.document.all;
if (wPopupElements.textcase.checked)
{iFlag=4;}
else
{iFlag=0;}
if (wPopupElements.searchtext.value==null || wPopupElements.searchtext.value=='')
{
wPopup.alert("Specify a value to search for");
return;
}
if (rng.findText(wPopupElements.searchtext.value,10000,iFlag)==true)
{
rng.select();
rng.scrollIntoView();
rng.moveStart("character");
}
else
{wPopup.alert("End of document");}
}function replace() {
var wPopupElements=wPopup.document.all;
if (wPopupElements.textcase.checked)
{iFlag=4;}
else
{iFlag=0;}
if (wPopupElements.searchtext.value==null || wPopupElements.searchtext.value=='')
{
wPopup.alert("Specify a value to replace for");
return;
}
if (rng.findText(wPopupElements.searchtext.value,-10000,iFlag)==true)
{
rng.text = wPopupElements.replacetext.value;
}
else
{wPopup.alert("End of document");}
}function replaceall() {
var rng = document.body.createTextRange();
var wPopupElements=wPopup.document.all;
if (wPopupElements.textcase.checked)
{iFlag=4;}
else
{iFlag=0;}
if (wPopupElements.searchtext.value==null || wPopupElements.searchtext.value=='')
{
wPopup.alert("Specify a value to replace for");
return;
}
for (i=0; rng.findText(wPopupElements.searchtext.value,10000,iFlag)!=false; i++)
{
rng.scrollIntoView();
rng.text = wPopupElements.replacetext.value;
}
setTimeout('wPopup.alert(i + " item(s) replaced!")',200);
}
//-->
</script><script>
<!--
function gofind() {
wPopup=window.open('about:blank','','width=350 height=110 left=200 top=200 menubar=no resizeable=no scrollbars=no toolbar=no');
var wPopupDoc=wPopup.document;
wPopupDoc.open();
wPopupDoc.write('<html>\n');
wPopupDoc.write('<head>\n');
wPopupDoc.write('<title>Find and Replace</title>\n');
wPopupDoc.write('<style>\n');
wPopupDoc.write('* {font-size:11px;font-family:"Tahoma","Verdana","Arial"}\n');
wPopupDoc.write('button {width:80}\n');
wPopupDoc.write('</style>\n');
wPopupDoc.write('</head>\n');
wPopupDoc.write('<body bgcolor="buttonface" leftmargin="0" topmargin="0">\n');
wPopupDoc.write('<table width="350" border="0" cellspacing="0" cellpadding="3" bgcolor="buttonface">\n');
wPopupDoc.write('<tr>\n');
wPopupDoc.write('<td>Find what:</td>\n');
wPopupDoc.write('<td><input type="text" name="searchtext" onchange="window.opener.rng=window.opener.document.body.createTextRange()"></td>\n');
wPopupDoc.write('<td><button accesskey="S" name="searchbutton" onclick="window.opener.search()"><u>S</u>earch</button></td>\n');
wPopupDoc.write('</tr>\n');
wPopupDoc.write('<tr>\n');
wPopupDoc.write('<td>Replace with:</td>\n');
wPopupDoc.write('<td><input type="text" name="replacetext"></td>\n');
wPopupDoc.write('<td><button accesskey="R" name="replacebutton" onclick="window.opener.replace()"><u>R</u>eplace</button></td>\n');
wPopupDoc.write('</tr>\n');
wPopupDoc.write('<tr>\n');
wPopupDoc.write('<td colspan="2"><input type="checkbox" name="textcase" value="textcase">Match Case</td>\n');
wPopupDoc.write('<td><button accesskey="A" name="replaceallbutton" onclick="window.opener.replaceall()">Replace<u>A</u>ll</button></td>\n');
wPopupDoc.write('</tr>\n');
wPopupDoc.write('<tr>\n');
wPopupDoc.write('<td colspan="2"> </td>\n');
wPopupDoc.write('<td><button accesskey="C" name="cancelbutton" onclick="window.close()"><u>C</u>ancel</button></td>\n');
wPopupDoc.write('</tr>\n');
wPopupDoc.write('</table>\n');
wPopupDoc.write('</body>\n');
wPopupDoc.write('</html>\n');
wPopupDoc.close();
}
//-->
</script>
<button onclick="gofind()">Find and Replace</button><pre>
What is FlashGet?
--------------------------------------------------------------------------------FlashGet is specifically designed to address two of the biggest problems when downloading files: Speed and management of downloaded files.</pre>
</body>
</html>
<html>
<head>
<title>Find and Replace Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<script>
<!--
var iFlag;
function search() {
var wPopupElements=wPopup.document.all;
if (wPopupElements.textcase.checked)
{iFlag=4;}
else
{iFlag=0;}
if (wPopupElements.searchtext.value==null || wPopupElements.searchtext.value=='')
{
wPopup.alert("Specify a value to search for");
return;
}
if (rng.findText(wPopupElements.searchtext.value,10000,iFlag)==true)
{
rng.select();
rng.scrollIntoView();
rng.moveStart("character");
}
else
{wPopup.alert("End of document");}
}function replace() {
var wPopupElements=wPopup.document.all;
if (wPopupElements.textcase.checked)
{iFlag=4;}
else
{iFlag=0;}
if (wPopupElements.searchtext.value==null || wPopupElements.searchtext.value=='')
{
wPopup.alert("Specify a value to replace for");
return;
}
if (rng.findText(wPopupElements.searchtext.value,-10000,iFlag)==true)
{
rng.text = wPopupElements.replacetext.value;
}
else
{wPopup.alert("End of document");}
}function replaceall() {
var rng = document.body.createTextRange();
var wPopupElements=wPopup.document.all;
if (wPopupElements.textcase.checked)
{iFlag=4;}
else
{iFlag=0;}
if (wPopupElements.searchtext.value==null || wPopupElements.searchtext.value=='')
{
wPopup.alert("Specify a value to replace for");
return;
}
for (i=0; rng.findText(wPopupElements.searchtext.value,10000,iFlag)!=false; i++)
{
rng.scrollIntoView();
rng.text = wPopupElements.replacetext.value;
}
setTimeout('wPopup.alert(i + " item(s) replaced!")',200);
}
//-->
</script><script>
<!--
function gofind() {
wPopup=window.open('about:blank','','width=350 height=110 left=200 top=200 menubar=no resizeable=no scrollbars=no toolbar=no');
var wPopupDoc=wPopup.document;
wPopupDoc.open();
wPopupDoc.write('<html>\n');
wPopupDoc.write('<head>\n');
wPopupDoc.write('<title>Find and Replace</title>\n');
wPopupDoc.write('<style>\n');
wPopupDoc.write('* {font-size:11px;font-family:"Tahoma","Verdana","Arial"}\n');
wPopupDoc.write('button {width:80}\n');
wPopupDoc.write('</style>\n');
wPopupDoc.write('</head>\n');
wPopupDoc.write('<body bgcolor="buttonface" leftmargin="0" topmargin="0">\n');
wPopupDoc.write('<table width="350" border="0" cellspacing="0" cellpadding="3" bgcolor="buttonface">\n');
wPopupDoc.write('<tr>\n');
wPopupDoc.write('<td>Find what:</td>\n');
wPopupDoc.write('<td><input type="text" name="searchtext" onchange="window.opener.rng=window.opener.document.body.createTextRange()"></td>\n');
wPopupDoc.write('<td><button accesskey="S" name="searchbutton" onclick="window.opener.search()"><u>S</u>earch</button></td>\n');
wPopupDoc.write('</tr>\n');
wPopupDoc.write('<tr>\n');
wPopupDoc.write('<td>Replace with:</td>\n');
wPopupDoc.write('<td><input type="text" name="replacetext"></td>\n');
wPopupDoc.write('<td><button accesskey="R" name="replacebutton" onclick="window.opener.replace()"><u>R</u>eplace</button></td>\n');
wPopupDoc.write('</tr>\n');
wPopupDoc.write('<tr>\n');
wPopupDoc.write('<td colspan="2"><input type="checkbox" name="textcase" value="textcase">Match Case</td>\n');
wPopupDoc.write('<td><button accesskey="A" name="replaceallbutton" onclick="window.opener.replaceall()">Replace<u>A</u>ll</button></td>\n');
wPopupDoc.write('</tr>\n');
wPopupDoc.write('<tr>\n');
wPopupDoc.write('<td colspan="2"> </td>\n');
wPopupDoc.write('<td><button accesskey="C" name="cancelbutton" onclick="window.close()"><u>C</u>ancel</button></td>\n');
wPopupDoc.write('</tr>\n');
wPopupDoc.write('</table>\n');
wPopupDoc.write('</body>\n');
wPopupDoc.write('</html>\n');
wPopupDoc.close();
}
//-->
</script>
<button onclick="gofind()">Find and Replace</button><pre>
What is FlashGet?
--------------------------------------------------------------------------------FlashGet is specifically designed to address two of the biggest problems when downloading files: Speed and management of downloaded files.</pre>
</body>
</html>
解决方案 »
- 一个简单的程序
- 如何往二维数组里添加值
- 请教 opera 有关问题 急!
- js如何实现页面内的跳转??
- 以下代码,不能点击链接,什么原因?
- javascript中如何取立方根?
- jquery galleryview插件,获得预览的图片的src
- 请问一个ActiveX对象在网页中,如何根据IE浏览器窗口大小的调整而调整???
- aptana的问题。
- jqueryEasyui的datagrid分页显示数据的问题
- 如何实现“函数”的wait操作?funcTestA() 在执行过程中要从 funcTestB 中得到一个数组,只有得到的值不为空,就可继续执行,否则一直在
- var hr_html = "<hr>....</tr>"; 如何将这个 hr_html 添加到 table 中去?而且是插入到 table 的最后一个 hr 的前一个位置,而不是 appen
js调用ie的查找ctrl+F