在线急等:window.location.search后参数截取问题,速度接~~~ http://www.51js.com/viewthread.php?tid=22720&&name=qq&&commandname=add&&age=16参数传递过来window.location.search后我想截掉“commandname=add”部分,可以怎么做? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 replace也可以啊s = window.location.search.replace(/commandname=add/i,"") 直接从url地址栏截掉???你需要重新设置过url如果你只是需要一个变量不包含commandname=add,去掉就好了var s=window.location.search;s=s.replace(/commandname=[^&]*/gi,"");alert(s)//如果需要重设url,取消下面的注释//window.location=window.location.pathname+s; 嗯,是的,要去掉“commandname=add”,然后再重新指定 var s=window.location.search;s=s.replace(/commandname=[^&]*/gi,"");alert(s)顶 怎么会有两个&?var s=window.location.search;s=s.replace(/commandname=[^&]*/gi,"").replace(/&&/gi,"&"); AspNetPager问题 Access 中怎样查询 日期为 单号 或双号? Thread.CurrentThread和session迷茫的问题 "发现同一依赖程序集的不同版本之间存在冲突"的警告怎么解决? 怎么做可以每日自动更新网站数据库一次 oracle10g连接oracle9i出鬼了 将项目拷到另一台机器上就出现错误了,大家帮帮我啊。 急,急 ,急奖励30分 孟子E章,问个问题可以吧,Web Service能不能包含界面(UI的部分) 在用datagird控时,删除一条记录时,要出现提示框,该如何做 啊, javascript判断文本框输入的是否是数字 验证问题
直接从url地址栏截掉???你需要重新设置过url如果你只是需要一个变量不包含commandname=add,去掉就好了var s=window.location.search;
s=s.replace(/commandname=[^&]*/gi,"");
alert(s)
//如果需要重设url,取消下面的注释
//window.location=window.location.pathname+s;
s=s.replace(/commandname=[^&]*/gi,"");
alert(s)
顶
var s=window.location.search;
s=s.replace(/commandname=[^&]*/gi,"").replace(/&&/gi,"&");