弹出框的使用
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
//status 是否显示状态栏 help是帮助栏提示
function test()
{
alert('haha');
}
function openDialog()
{
var result = window.showModalDialog("2.html","","dialogHeight:200px;dialogWidth:200px;edge:sunken;help=no;status=no");
//alert(result);
document.getElementById("user1").value=result;
}
</script>
</head>
<body>
<input type="button" οnclick="test()">
<button id="dialog" οnclick="openDialog()">打开对话框</button>
<input name="user1" id="user1" type="text">
</body>
</html>
对应2.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
function closeWindow()
{
alert( window.dialogArguments);
window.returnValue = "biaobiao";
window.close();
}
</script>
</head>
<body>
<div>
<form>
收件人:<input type="text">
主题:<input type="text">
内容:<textarea></textarea>
</form>
<a href="http://www.cnblogs.com/hynxy0115/archive/2009/03/18/1415654.html">href</a>
<input type="button" οnclick="closeWindow()" value="关闭窗口"/>
</div>
</body>
</html>
json--java之间转换