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>
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"))