我有一个简单的HTML(如HTA)应用程序,显示在Windows XP x64的机器奇怪的行为。我定期(不是每次)错误信息收到访问被拒绝。当我启动应用程序。在Windows XP 32位的同一个应用程序运行得很好......
是否有人有任何想法或解释?
错误信息: 行:18 字符:6 错误:访问被拒绝。 code:0 网址:文件:/// D:/test_j.hta
下面是我的test_j.hta的code:
< HTML>
< HEAD>
<冠军>试验J< /标题>
< HTA:APPLICATION
ID =objTestJ
APPLICATIONNAME =TestJ
SCROLL =无
SINGLEINSTANCE =YES
WINDOWSTATE =正常
>
<脚本语言=JScript的>
函数main()
{
//window.alert("test);
window.resizeTo(500,300);
}
功能OnExit()
{
window.close()的;
}
< / SCRIPT>
< /头>
<身体的onload =main()的>
<输入类型=按钮值=退出NAME =退出的onClick =OnExit()称号=退出>
< /身体GT;
< / HTML>
解决方案
尝试添加尝试捕捉周围的启动code
尝试
{
window.resizeTo(500,300);
}赶上(五){}
另外尝试的setTimeout: -
的setTimeout(函数(){
window.resizeTo(500,300);
},100);
I have a simple HTML (as HTA) application that shows strange behavior on Windows XP x64 machine. I getting periodically (not every time) error message "Access is denied." when i start the application. The same application on Windows XP 32bit runs just fine...
Does somebody has any idea or explanation?
Error message: Line: 18 Char: 6 Error: Access is denied. Code: 0 URL: file:///D:/test_j.hta
Here is the code of my "test_j.hta":
<html>
<head>
<title>Test J</title>
<HTA:APPLICATION
ID="objTestJ"
APPLICATIONNAME="TestJ"
SCROLL="no"
SINGLEINSTANCE="yes"
WINDOWSTATE="normal"
>
<script language="JScript">
function main()
{
//window.alert("test");
window.resizeTo(500, 300);
}
function OnExit()
{
window.close();
}
</script>
</head>
<body onload="main()">
<input type="button" value="Exit" name="Exit" onClick="OnExit()" title="Exit">
</body>
</html>
解决方案
Try adding a try catch around the startup code
try
{
window.resizeTo(500, 300);
} catch(e) { }
Alternatively try setTimeout:-
setTimeout(function() {
window.resizeTo(500, 300);
}, 100);
相关推荐
最新文章