页面1传递信息到页面2
function checkSclideDetail(){
var row = $('#dg').datagrid('getSelected');
var schStyleId1 = row.schStyleId;
alert(schStyleId1);
window.location.href="backstage/b_schStylePic.jsp?schStyleId="+schStyleId1;
}
页面2如何获取request 中的信息
schStyleId
如果jsp 页面获取为
<%
String abc=request.getParameter("schStyleId");
System.out.println("asdfadsfasdf"+abc);
%>
如果在js 中获取为 写一个functionhanshu
function getUrlParam(name){
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r!=null) return unescape(r[2]); return null;
}
然后可以直接调用该function
$(function() {
var schStyleId = getUrlParam("schStyleId") ;
alert(schStyleId);
$('#dg').datagrid( {
url :"schStylePic/schStylePic_getSchSlidePicList.action?schStyleId="+schStyleId,
columns : [ [ {
.........