js获取页面传值

代码
   
     
// 在页面A传值:
window.showModalDialog( " ModalDialogFrame.aspx?Title=选择组织部门&PageUrl=ParentTreeView.aspx " ,window, " dialogWidth=380px;dialogHeight=650px;status=no;center=yes; " );view plaincopy to clipboardprint ?

// 在页面ModalDialogFrame.aspx:

function GetQueryString(sProp)

{

var re = new RegExp( " [&,?] " + sProp + " =([^\\&]*) " , " i " );

var a = re.exec(document.location.search);

if (a == null )

return "" ;

return a[ 1 ];

}

// 在页面ModalDialogFrame.aspx:
function GetQueryString(sProp)
{
var re = new RegExp( " [&,?] " + sProp + " =([^\\&]*) " , " i " );
var a = re.exec(document.location.search);
if (a == null )
return "" ;
return a[ 1 ];
}view plaincopy to clipboardprint
?



// 调用方法:

var url = GetQueryString( " PageUrl " ); // ParentTreeView.aspx

var title = GetQueryString( " Title " ); // 选择组织部门

 

你可能感兴趣的:(js)