$(function() { var url = decodeURI(location.search); if (url.indexOf("?") != -1) { var str = url.substr(1) strs = str.split("&"); var HSCode = strs[0]; var HSCode = HSCode.substr(7); alert(HSCode); var HSName = strs[1]; var CargoNa
这篇文章主要介绍了通过window.location.search来获取页面传来的参数,经测试是OK的 ? 1 2 3 4 5 function GetQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)","i"); var r = window.location.search.substr(1).match(reg); if (
location.search是从当前URL的?号开始的字符串如:http://www.51js.com/viewthread.php?tid=22720它的search就是?tid=22720 通过这个函数就可以轻易取到连接后面带的参数,这个可用户父窗口向子窗口传递参数eg:Java代码: function openTable(id){ var feathers="status=no,width=650px,height=670px,top=0px,menubar=no,resizabl
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
document.location.search 的作用 document.location.search 比如一个URL是XXXX?g=1,那么document.location.search的值就是?g=1 function changeLocationParameter(nameArray,valueArray) { var parameter=document.location.search.toString(); var pname; var pstart,pend; for(var
ocation.search是从当前URL的?号开始的字符串 如:http://www.51js.com/viewthread.php?tid=22720 它的search就是?tid=22720 eg: function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = win