JS加载获取父窗体传递的参数 $(document).ready(function () { var query = location.search.substring(1); var values = query.split("&"); for (var i = 0; i < values.length; i++) { var pos = values[i].indexOf('='); if (pos == -1) continue; var paramname = v
function GetQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = decodeURI(window.location.search.substr(1)).match(reg); if (r != null)return unescape(r[2]); return null; } var sname = GetQuer
String.prototype.GetValue= function(parm) { var reg = new RegExp("(^|&)"+ parm +"=([^&]*)(&|$)"); var r = this.substr(this.indexOf("\?")+1).match(reg); if (r!=null) return unescape(r[2]); return null; }完整测试代码test.
function getQueryString(key){ var href=window.location.href; var reg = new RegExp(key +"=([^&]+)"); var march=reg.exec(href); if(march!=null){ var value=march[1]; return value; } return null; }
一.path核心模块 ①path.basename(path[,ext])获取一个路径中的文件名 var path=require('path'); console.log(path.basename('C:/Files/nodejs/a.js'));//a.js console.log(path.basename('C:/Files/nodejs/a.js','.js'));//a ②path.dirname(path) 获取一个路径中的目录 var path=require('path')