主页向iframe页面某元素传值的一个问题

function getDetail(customerNo){
document.getElementById("iframe").src="<%=ctx%>/system/cus/showDetailHotCustomerAction.action?customer.customerNo="+customerNo;
window.frames["iframe"].document.getElementsByName("hiddenCustomerNo")[0].value=customerNo;
}

是这样子的 我把customerNo值已经传给iframe下的元素“hiddenCustomerNo” 了

但是iframe刷新了一下 传过去的值没了,原因是这个函数了执行了 document.getElementById("iframe").src="<%=ctx%>/system/cus/showDetailHotCustomerAction.action?customer.customerNo="+customerNo;代码,action里又重新跳回来所以刷新了页面,值就没了,有什么方法可以解决这个问题?

在主窗口中定义一个变量来接受,由iframe子窗口来取