var geturl = function(url){ var ret = {}; var queryStr=url.replace(/^[^\?#]*\??/g,'').replace(/#DIALOG_.*$/g,''); queryStr.replace(/([^=&]+)=([^&]*)/g, function (a, b, c) { b = decodeURIComponent(b); c = decodeURIComponent(c); ret[b] = c; ret[b.to
在js字符串对象原型中添加这个获取链接参数值方法,getAddrVal(): String.prototype.getAddrVal = String.prototype.getAddrVal||function(name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var data = this.substr(1).match(reg); return data!=null
public class HomeController : Controller { public ActionResult Index() { var url = "http://www.ly.com?ak=abcdefg&user=sbd"; var queryString = "ak=hello&user=test&passpord=111"; url = this.DealQueryString(url, queryString);
getQueryString:function(name) { var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r!=null)return unescape(r[2]); return null; } 例如: www.baidu.com?id=10 这里调用上述fuc,并
function getQueryString(name) { var reg = new RegExp(name +"=([^&]*)"); var r = window.location.href.match(reg); ]); return null; } function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|
看别的博客有用eval执行正则表达式的写法, //替换指定传入参数的值,paramName为参数,replaceWith为新值 function replaceParamVal(paramName,replaceWith) { var oUrl = this.location.href.toString(); var re=eval('/('+ paramName+'=)([^&]*)/gi'); var nUrl = oUrl.replace(re,paramName+'='+replaceW
Oracle 用Drapper进行like模糊传参查询需要在参数值前后带%符合 string sqlstr="select * from tblname where name like :name"; var paramvalue = string.Format("%{0}%", keyword); object param = new { name= paramvalue }; var datas = conn.Query<TAXI_INFO>(s