我创建了一个HTA应用程序文件。它工作正常,但我希望它看起来不错,所以一直用CSS造型。
浏览器没有正确的样式,所以我搜索并发现如果我添加
<meta http-equiv="x-ua-compatible" content="ie=9">
它完美地设计了所有内容,但是对此,我无法使用我的VBScript脚本,如果失败
错误:'test1'未定义
如果我删除元标记并重新加载HTA VBScript脚本工作正常,但再次丑陋......
可以调整实际工作并且看起来不错吗?
我的电脑正在运行Windows 8.1和IE11。
脚本示例如下:
<!DOCTYPE html>
<html>
<head>
<title>Shortcuts</title>
<style type="text/css">
html, body{
padding: 0;
margin: 0;
height: 100%;
width: 100%;
background-color: #BBDEFB;
}
ul{
padding: 2px;
list-style-type: none;
margin: 0;
}
a{
color: #EDE7F6;
text-decoration: none;
}
a:hover{
padding: 0px;
padding-left: 5px;
padding-right: 5px;
background-color: #64B5F6;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;
}
a:active{
background-color: #42A5F5;
}
li{
text-align: center;
text-decoration: none;
list-style-type: none;
background-color: #42A5F5;
-webkit-box-shadow: 0 8px 6px -6px grey;
-moz-box-shadow: 0 8px 6px -6px grey;
box-shadow: 0 8px 6px -6px grey;
}
input{
background-color: #64B5F6;
border: 0px;
}
input:focus{
-webkit-box-shadow: 0 8px 6px -6px grey;
-moz-box-shadow: 0 8px 6px -6px grey;
box-shadow: 0 8px 6px -6px grey;
}
</style>
<hta:application
id="Shortcuts_REDO"
icon="icon.ico"
version="0.0"
contextmenu="no"
singleinstance="yes"
applicationname="Shortcuts_REDO"
border="thin"
borderStyle="normal"
caption="yes"
maximizeButton="no"
minimizeButton="yes"
showInTaskbar="yes"
windowState="normal"
innerBorder="yes"
navigable="no"
scroll="auto"
scrollFlat="yes"
sysMenu="yes"
selection="no"
>
<script language="VBScript">
Sub Window_onLoad
window.offscreenBuffering = True
window.ResizeTo 250, 650
End Sub
Sub test1
MsgBox "test"
End Sub
</script>
</head>
<body>
<input type="button" value="test" onClick="test1" style="height: 22px; width: 100px" Title="Prompt">
<div class="main-container">
<ul>
<li>Call Templates</li>
<li><a href="#"> New Call </a></li>
<li><a href="#"> Existing Call </a></li>
<li><a href="#"> Follow-up Email </a></li>
<li><a href="#"> Search Tickets logged </a></li>
<br>
<li>...</li>
<br>
<li>
Remote PC
<input type="text" name="RemotePC" value="pc-" maxlength="10">
</li>
<li><a href="#"> Command Prompt </a></li>
<li><a href="#" onClick="test1"> Notepad </a></li>
<li><a href="#"> Remote Desktop </a></li>
<li>...</li>
<li>Wiki Search</li>
<li>Google Search</li>
<li>Contacts</li>
<li>Phone book</li>
<li>...</li>
<li>...</li>
<li>...</li>
<li>Active Directory Searches</li>
<li>Export users or groups</li>
<li>Password Reset</li>
<li>...</li>
<li>Re-create</li>
<br>
<br>
<select size="1" name="DropDown" onChange="RunLinkSelection" style="width: 100px">
<option value="1"> ... </option>
<option value="2"> Forms </option>
<option value="3"> Intranet </option>
</select>
<br>
<br>
<li>Settings</li>
<li>About</li>
<li>...</li>
</ul>
</div> <!-- end of main-container -->
</body>
</html>