第一种、页面上的

//js接受页面的传值 例如?id=1

var dd = window.location.search.substring(1,location.search.length); 
alert(dd); //id=1


function GetQueryString(name)  
{
  var regex = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  var r = window.location.search.substr(1).match(regex);
  if(r!=null) return unescape(r[2]);
  return null;  
}  
alert(GetQueryString("id")); //1

第二种,iframe的

js里面接受传过来的值
Request('id')
例如:
--第一个界面
<iframe src="HtmlEditor/editor.html?id=content" frameborder="0" id="frm" scrolling="no" ></iframe>
--第二个界面
js里面

var txt=Request('id');

posted on 2012-07-19 15:32  成天狂  阅读(479)  评论(0编辑  收藏  举报