<html>
<head>
<title></title>
<script>
window.onload = function(){
div2.innerHTML = div1.innerHTML.replace(/ShowClass/g,"ShowWzClass");
}
</script>
</head>
<body>
替换前:
<div id="div1">
<xmp>
<DIV id=ware_right_10> <div class="show_page">共 <b>300 </b> 个商品 首页 | 上一页 | <font color="FF0000">1 </font> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=2">2 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=3">3 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=4">4 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=5">5 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=6">6 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=7">7 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=8">8 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=9">9 </a> | <a href='/YLcn/Shop/ShowClass.asp?ClassID=1&page=2'>下一页 </a> | <a href='/YLcn/Shop/ShowClass.asp?ClassID=1&page=11'> 尾页 </a> <b>28 </b>个商品/页 转到第 <Input type='text' name='page' size='3' maxlength='5' value='1' onKeyPress="if (event.keyCode==13) window.location='/YLcn/Shop/ShowClass.asp?ClassID=1&page='+this.value;">页 </div> </DIV>>
</xmp>
</div>替换后:
<div id="div2"></div>
</body>
</html>
解决方案 »
- 表单需要JS判断,IE下能正常提交,到火狐就不行了,请大大帮忙下
- javascript 正規化問題
- 求个JS判断来访IP,而设置跳转页面的代码
- 请教个JS和JAVA的问题~~~
- 请教,关于js控制页面数据导入excel
- 请教:如何使用javascript将图片旋转90度?
- 如果让text在输入的时候不横向滚动? 比如长度为10的text,只能输入10个,而不是超长以后滚动
- VBscript如何判断哪一个单选框被选中了
- 如何清除Select控件中的项?
- 如何使一个页面只能被打开一次且在此页面不被关闭的情况下再次打开时此页面不刷新?(puppeter)
- 怎样在Action中获得到js中的值
- 关于window.showModalDialog子窗口对父窗口操作的问题
<head>
<title></title>
<script>
window.onload = function(){
div2.innerHTML = div1.innerHTML.replace(/ShowClass/g,"ShowWzClass");
}
</script>
</head>
<body>
替换前:
<div id="div1">
<xmp>
<DIV id=ware_right_10> <div class="show_page">共 <b>300 </b> 个商品 首页 | 上一页 | <font color="FF0000">1 </font> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=2">2 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=3">3 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=4">4 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=5">5 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=6">6 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=7">7 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=8">8 </a> <a href="/YLcn/Shop/ShowClass.asp?ClassID=1&page=9">9 </a> | <a href='/YLcn/Shop/ShowClass.asp?ClassID=1&page=2'>下一页 </a> | <a href='/YLcn/Shop/ShowClass.asp?ClassID=1&page=11'> 尾页 </a> <b>28 </b>个商品/页 转到第 <Input type='text' name='page' size='3' maxlength='5' value='1' onKeyPress="if (event.keyCode==13) window.location='/YLcn/Shop/ShowClass.asp?ClassID=1&page='+this.value;">页 </div> </DIV>>
</xmp>
</div>替换后:
<div id="div2"></div>
</body>
</html>
document.all.ware_right_10.innerHTML=document.all.ware_right_10.innerHTML.replace(/ShowClass/gi,'ShowWzClass');
}
var b=document.getElementById("ware_right_10").innerHTML;
var c=b.replace(/ShowClass/gi,"ShowWzClass");
alert(c);
</script>