L@_@K
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head> <body>
<script type="text/javascript">
<!--
var url="http://192.168.1.88/511/productclass.asp?id=384&act=low&page=2009";
var re = /&page=\d+/gi;
var newUrl = url.replace(re, "");
document.write(newUrl);
//-->
</script>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head> <body>
<script type="text/javascript">
<!--
var url="http://192.168.1.88/511/productclass.asp?id=384&act=low&page=2009";
var re = /&page=\d+/gi;
var newUrl = url.replace(re, "");
document.write(newUrl);
//-->
</script>
</body>
</html>
解决方案 »
- jquery ajax调用xml静态文件,ie下无法识别的问题
- 用图片来代替radio按钮,希望选中之后图片有所变化,应该怎么做,那位高人知道啊?急!!!!
- 商务通这个功能怎么实现的,大家来讨论讨论
- .innerHTM的值如何附给一个变量?
- select框动态操作
- 关于梅花雪树型控件(MzTreeView1.0)的一个奇怪现象~~~~~
- 使用showModelessDialog方式打开子窗口,怎样在子窗口的Button中关闭父窗口?
- 字符串处理问题!
- 如何在Netscape和IE中都限制输入栏中只能填入数字??谢谢各位大哥
- 各位高手,请帮忙!
- 如果让IE7不会禁止访问计算机的脚本?
- 网页中使用 activex插件问题
var url2 = "http://192.168.1.88/511/productclass.asp?page=2&act=low";alert(clearPage(url1));
alert(clearPage(url2));
function clearPage(url)
{
return url.replace(/[?&]page=\d&{0,}/g,function(m)
{
return m.charAt(0)=="&" ? "" : "?";
});
var url2 = "http://192.168.1.88/511/productclass.asp?id=384&page=2&act=low"
var url3 = "http://192.168.1.88/511/productclass.asp?id=38&act=low4&page=2"
var re=/\&page\=\d+([&]{0,1})/gi;
alert(url1.replace(re,"$1"))
alert(url2.replace(re,"$1"))
alert(url3.replace(re,"$1"))