js获取页面get传递的参数
2016-12-20 21:45
197 查看
function getparastr(strname) { var hrefstr, pos, parastr, para, tempstr; hrefstr = window.location.href; pos = hrefstr.indexOf("?") parastr = hrefstr.substring(pos + 1); para = parastr.split("&"); tempstr = ""; for (i = 0; i < para.length; i++) { tempstr = para[i]; pos = tempstr.indexOf("="); if (tempstr.substring(0, pos) == strname) { return tempstr.substring(pos + 1); } } return null; }
相关文章推荐
- 在HTML页面用JS获取Get参数方法
- 后端往前段传递参数,大部分人都清楚,无非就是发起ajax请求获取后端值,然后通过js写入html相应位置即可。但是前段html页面之间,怎么传递参数呢?
- JS控制静态页面之间传递参数获取参数并应用(window.location)
- JS控制静态页面之间传递参数获取参数并应用(window.location)
- JS控制静态页面之间传递参数获取参数并应用
- 在一个页面文件中(JSP 或者HTML)使用href 跳转另一个页面时使用Js中获取传递过来的参数
- js前端获取页面传递的参数
- 在jsp页面 JS获取URL传递的参数
- JS控制静态页面之间传递参数获取参数并应用的简单实例
- JS实现网页开窗刷新 GeT传递参数成功 远程打开页面失败的解决方法
- JS获取上个页面超链接传递的参数
- js 获取url中的参数进行跨页面传递
- JS控制静态页面传递参数并获取参数应用
- javascript获取超链接传递的参数,此方法亦能解决2个通过js超链页面传递参数的乱码问题
- js获取页面传递参数(完整版)
- 加载js 简单获取get传递参数
- 从外部的js文件中获取ASPX页面的控件ClientID(get control reference from external javascript)
- 从内部和外部的js文件中获取ASPX页面的控件ClientID(get control reference from inline and external javascript)
- 获取为JS文件传递的参数【完整版】(转载)
- JS与Struts1参数传递获取中文乱码问题