【问题标题】:HTA back button not workingHTA 后退按钮不起作用
【发布时间】:2014-09-22 13:20:04
【问题描述】:

以下代码上的后退按钮不起作用。当我单击返回时,它不会进入上一页。谁能建议我怎样才能让它工作?感谢您的建议。我尝试了很多以检查所有可能的情况。我没有让这个工作。

<html>
<head>
<title>Title</title>
<HTA:APPLICATION ID="Main" 
APPLICATIONNAME="Main Application"
BORDER="thin"
BORDERSTYLE="normal"
CAPTION="yes"
CONTEXTMENU="no"
ICON=""
SHOWINTASKBAR="no"
SINGLEINSTANCE="yes"
SYSMENU="yes"
NAVIGABLE="yes"
MAXIMIZEBUTTON="no"
MINIMIZEBUTTON="no" />
<script language="VBScript" type="text/vbscript">
function doValidation()
dbalias=frmMyForm.test.Value
IF len(dbalias)=0 then
    document.writeln("Please select the Environment and Try again")
    doValidation=False
    document.writeln("<br><tr><td nowrap align=Center colspan=2><input    type=button value=Back name=ClickBack onclick=history.back()></td></tr>")
End if
End function
Sub cmdSubmit_OnClick
if (doValidation()) Then
    dbalias=frmMyForm.test.Value
    MGSBOX DBALIAS
End if
End Sub
</script>
</head>
<body bgcolor="#E6E6FA">
    <h1 align="center"><font face="Times Roman"   color="blue">Title</font></h1>
    <form action="temp3.php" name="frmMyForm" id="frmMyForm" method="post">
    <fieldset>
    <label>* Select the Test </label>
        <select name="test" id="test">
            <option value="" selected></option>
            <option value="test1">Test1</option>
            <option value="test2">Test2</option>
            <option value="test3">Test3</option>
        </select>
<br>
    <input type="button" name="cmdSubmit" id="cmdSubmit" value="Submit" style="height:25px; width:60px">
</fieldset>
 </form>
 </body>
 </html>

【问题讨论】:

  • 请定义“不工作”。请注意,您不能以您现在使用的方式使用document.writeln()。它会打开一个新文档并清除当前文档的所有内容。

标签: html vbscript hta


【解决方案1】:

根据this horse's mouth,.HTA 不支持历史记录。这似乎是合理的,因为 .HTA 缺少 IExplorer 的 chrome/gui。该链接提供了一个可以移植到 VBScript 的 JScript 实现,尽管应该首先解决 @Teemu 的问题。

更新 Teemu 的评论:

另一个mouth 提到历史问题 - 在 IE 10 上。所以也许它版本的事情。有趣的是,这匹马切换到了IE kiosk模式;也许这可能是解决旧约现实世界问题的另一种方式。

【讨论】:

  • “马嘴”?我很确定我在this MSDN page 的列表中看到了history。然而,它已经不存在了。不久前有人问过类似的问题,我做了一个测试,用 IE11 运行的 HTA 实际上支持history。所以,我想这是一个版本相关的问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-12-27
  • 2014-05-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-07-24
相关资源
最近更新 更多