文章标题

来源:互联网 发布:mac锁定触控板快捷键 编辑:程序博客网 时间:2024/06/07 00:50

//获取页面传来的值得方法
例如A页面向B页面传值
注意,这个只是可以获得页面传来的url地址,用的时候直接把他放到要传入的页面就可以就是放入B页面
B页面:

//方法调用:var txsd = getRequest();//xsd.servicemodelids,是A页面的Url问号后面的key如果是id那么就要写入txsd.idvar servicemodelId = txsd.servicemodelids;
function getRequest() {        var url = window.location.search;        var theRequest = new Object();        if (url.indexOf("?") != -1) {            var str = url.substr(1);            strs = str.split("&");            for ( var i = 0; i < strs.length; i++) {                theRequest[strs[i].split("=")[0]] = decodeURI(strs[i]                        .split("=")[1]);            }        }        return theRequest;    }

跳转:页面A页面的
给A页面添加

document.getElementById("serviceModelids").setAttribute("href","serviceModelUpdate.jsp?         servicemodelids="+s); 

//jquery事件

<a id="serviceModelids" href=""class="easyui-linkbutton btn_state" style="margin-bottom: -40px;"  iconCls="icon-edit">Modify</a>
原创粉丝点击