我有两个经典的 asp 文件,default.asp 创建一个对话框并打开加载 default2.asp default2.asp 显示一些控件和一个链接,该链接调用一个 javascript 函数,该函数执行一些活动并关闭对话框
这件事在 Chrome 中运行良好,但在 IE 9.0 中运行良好,有人知道为什么吗?将不胜感激。
谢谢
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Default.asp</title>
<link rel="stylesheet" href="/jquery/themes/base/jquery-ui.css" />
<script src="/JQuery/jquery-1.9.1.js"></script>
<script src="/JQuery/jquery-ui.js"></script>
<style>
body { font-size: 85.5%; }
div#mydiv { width: 350px; margin: 20px 0; }
</style>
<script>
$(document).ready(function(){
var MyDlg = $( "#mydiv" );
MyDlg.dialog({
autoOpen: false,
closeOnEscape: true,
modal: true,
width: 300,
height: 400,
modal: true,
resizable: true,
buttons: {
Cancel: function() {
MyDlg.dialog( "close" );
}
}
});
$("#Opendlg").click(function() {
MyDlg.load("Default2.asp").dialog("open");
});
});
</script>
</head>
<body>
This is a test form-1
<br><br>
<%
Dim FName, LName
FName = Request.form("fname")
LName = Request.form("lname")
Response.write("The First name was := " & FName & " and Last name was:=" & LName )
%>
<br><br>
<form ID=Form1 method="post" action="Default.asp">
First Name: <input type="text" name="fname"><br>
Last Name: <input type="text" name="lname"><br><br>
<input type="submit" value="Submit">
</form>
<br><br>
<input type="button" class="ui-widget" ID="Opendlg" value="Open Dialog"/>
<div id="mydiv" title="Product Wizard">
</div>
</body>
</html>
------------------------- Default2.asp---------- ------------------------------
<script type="text/javascript">
$(function() {
$('#Form2').submit(function(evt) {
evt.preventDefault();
$.ajax({
url: "Default2.asp",
type: 'POST',
data: $(this).serialize(),
success: function(result) {
$('#mydiv').html(result);
}
});
});
});
var MyDlg = $( "#mydiv" );
$(".ui-widget-overlay").click (function () {
MyDlg.dialog( "close" );
});
function CloseMe()
{
$("#mydiv").dialog("close");
}
</script>
This is Default2.asp file
<br><br>
<%
Dim Name, Address
Name = Request.form("Name")
Address = Request.form("address")
Response.write("The Name was " & Name & " and Address was " & Address )
%>
<a href="Javascript:CloseMe();">Close Me</a>
<br><br>
<form ID=Form2 >
Name: <input type="text" name="Name"><br>
Address: <input type="text" name="address"><br><br>
<input type="submit" value="Submit">
</form>