<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!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 > dialog</title >
<link rel ="stylesheet" href ="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" >
<script src ="//code.jquery.com/jquery-1.9.1.js" > </script >
<script src ="//code.jquery.com/ui/1.10.4/jquery-ui.js" > </script >
<link rel ="stylesheet" href ="http://jqueryui.com/resources/demos/style.css" >
<script type ="text/javascript" >
$(function () {
$("#dialog1" ).dialog({
resizable : false ,
height : 300 ,
position : [200 ,100 ],
modal : true ,
buttons : {
"确定" : function () {
$(this ).dialog("close" );
},
"取消" : function () {
$(this ).dialog("close" );
}
}
}).show();
var lang = "en" ;
var str1 = {
en : "sure" ,
zh : "确定"
};
var str2 = {
en : "cancel" ,
zh : "取消"
};
var buttons = {};
var btn1 = "" ;
var btn2 = "" ;
if (lang == "en" ){
btn1 = str1.en;
btn2 = str2.en;
}else {
btn1 = str1.zh;
btn2 = str2.zh;
}
buttons[btn1] = function () {
$( this ).dialog( "close" );
};
buttons[btn2] = function () {
$( this ).dialog( "close" );
};
$("#dialog2" ).dialog({
resizable : false ,
height : 300 ,
position : [600 ,100 ],
modal : true ,
buttons : buttons
}).show();
});
</script >
</head >
<body >
<div id ="dialog1" title ="dialog测试数据" > dialog1</div >
<div id ="dialog2" title ="dialog测试数据" > dialog2</div >
</body >
</html >