这不能将焦点返回到Firefox 4和5中的父窗口
<html>
<head>
<script type="text/javascript">
function openWin()
{
myWindow=window.open('','','width=200,height=100');
myWindow.document.write("<p>The new window.</p>");
myWindow.blur();
window.focus();
}
</script>
</head>
<body>
<input type="button" value="Open window" onclick="openWin()" />
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
如何使用javascript将焦点返回到父窗口?
1942年4月3日有什么特别的东西吗?出于某种原因,第0天(上午12:00)的小时在此特定日期是非法的.使用宽松日历但一天中的小时增加到1(凌晨1:00)时接受日期.
相关代码
java.util.Calendar calendar = java.util.Calendar.getInstance(
java.util.TimeZone.getTimeZone("Europe/Helsinki")
);
calendar.clear();
calendar.setLenient(false);
calendar.set(1942, 3, 3, 0, 0, 0);
calendar.getTimeInMillis();
Run Code Online (Sandbox Code Playgroud)
例外
java.lang.IllegalArgumentException: HOUR_OF_DAY
at java.util.GregorianCalendar.computeTime(Unknown Source)
at java.util.Calendar.updateTime(Unknown Source)
at java.util.Calendar.getTimeInMillis(Unknown Source)
Run Code Online (Sandbox Code Playgroud)
我真的更喜欢日期并不宽松,因为我不想接受不可能的日期.
- 编辑
正如公认的答案和许多评论所指出的那样,这确实与夏令时有关.1942年4月3日00:00,在EEST /赫尔辛基时区测试了夏令时.目前,自1981年以来一直在使用夏令时,时钟在03:00而不是00:00前进.这意味着java.util.Calendar中不存在e 2010年3月28日03:00.
我只需要在我的代码中为这个特定日期创建一个特例.
我需要将textarea添加到对话框中.如果有任何想法,请建议我.这是我的代码......
var story = changeStory();
$.ajax({
async: false,
type:"GET",
data:{"story":story},
url: "./teststory.action",
dataType: 'json',
success: function(json){
var i = 0;
var jsonList = "";
$.each(json, function(index,job) {
if(i > 0){
jsonList = jsonList + ",";
}
jsonList = jsonList + "[";
jsonList = jsonList + "{";
......
jsonList = jsonList + "}";
jsonList = jsonList + "]";
**var newDiv = $(document.createElement('div'));
$(newDiv).text();
$(newDiv).dialog({modal: true, width:850, height:500, title:"JSON for Demo Story"}).dialog("open");**
*var obj=document.createElement('textarea');
obj.setAttribute("style","padding-left:100");
obj.value=jsonList;
document.body.appendChild(obj);*
storyLst = jsonList;
});
} …Run Code Online (Sandbox Code Playgroud)