var userChoice = showModalDialog("../Iframe.aspx?FormName=sample.aspx", window, "dialogTop:300px;dialogLeft:350px;dialogHeight:182px;dialogWidth:370px;help:no;scroll:no;status:no;");
alert(userChoice); /* here iam not able to get 'Y' */
if (userChoice == 'Y')
return true; else return false;
Below is the Sample aspx page:
input type="button" value="Yes" onclick="choice('Y')"
function userChoice(option)
{
window.returnValue = option;
alert(window.returnValue); /* here iam getting 'Y' */
parent.close(); // I have tried with self.close() also
}
答案 0 :(得分:1)
您无法从模态对话框中关闭parent.window
。使用window.close()
或top.close()
关闭模式。
Chrome中存在returnValue
的错误,似乎还没有修复,请尝试这些: