我正在尝试在不使用引导程序的情况下在我的网页上创建一个弹出对话框。我试着使用对话框jquery选项。我面临的问题是相同的代码在chrome中工作,但在mozilla firefox中没有。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Dialog - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$(document).ready(function() {
var pos = { of: window };
/////////
$(function() {
$( "#my_dialog" ).dialog({
autoOpen: false,
position:pos,
buttons: {
"Close ": function() {
$( this ).dialog( "close" );
},
"Submit ": function(){
$('#msg').html($("#f1").serialize());
$( this ).dialog( "close" );
}
}
});
});
/////////
$("#b1").click(function(){
$( "#my_dialog" ).dialog( "open" );
})
})
</script>
</head>
<body>
<h2>JavaScript Prompt</h2>
<button id="b1">Open Dialog Box</button><div id=msg></div>
<div id="my_dialog" title="plus2net dialog"><form id=f1>
<p>First Name<input type="text" id=t1 name=t1><br>
</div>
</body>
</html>