admin管理员组文章数量:1312973
everytime when i try to add javascript in a hta file with vbscript it es an error message when i click the submit button:
object doesn't support this property or method
I try this
<script type="text/javascript" src=""></script>
and this
<script type="text/javascript">
...code
</script>
Is there anyone who know the problem?
//EDIT: I have the problem, i forgot a VBScript: to call the vbscript sub THANKS!!
<input type="submit" value=" Submit " onclick="Submit" style="margin-left:100px;">
This is the right one:
<input type="submit" value=" Submit " onclick="VBScript:Submit" style="margin-left:100px;">
everytime when i try to add javascript in a hta file with vbscript it es an error message when i click the submit button:
object doesn't support this property or method
I try this
<script type="text/javascript" src=""></script>
and this
<script type="text/javascript">
...code
</script>
Is there anyone who know the problem?
//EDIT: I have the problem, i forgot a VBScript: to call the vbscript sub THANKS!!
<input type="submit" value=" Submit " onclick="Submit" style="margin-left:100px;">
This is the right one:
<input type="submit" value=" Submit " onclick="VBScript:Submit" style="margin-left:100px;">
Share
Improve this question
edited Jul 1, 2010 at 14:05
Sebastian
asked Jul 1, 2010 at 13:40
SebastianSebastian
5146 gold badges18 silver badges34 bronze badges
1
-
Please show the full code of what you are trying to do. Also, you are talking about VBScript: Why are you specifying
text/javascript
as a type then? – Pekka Commented Jul 1, 2010 at 13:41
1 Answer
Reset to default 6It's hard to be sure because your question is not plete, however it is likely that you are putting your Javascript code inside VBScripts <script></script>
tags.
'' is like an opening bracket, and '' is like a closing bracket. The VBScript tags are only for VBScript and the Javascript ones are only for Javascript.
Put the following in SILLY.HTA and try it out:
<html>
<head>
<title>My Silly Application</title>
<HTA:APPLICATION>
</head>
<body>
<script language="vbscript">
document.title = "NOT SO SILLY NOW"
self.ResizeTo 200,200
Sub Window_Onload
self.MoveTo (screen.availWidth - (document.body.clientWidth + 40)),10
End Sub
</script>
<script language="javascript">
window.resizeTo(640, 480);
document.write("<h1>Something from Javascript</h1>");
</script>
</body>
本文标签: vbscriptJavascript in HTA FileStack Overflow
版权声明:本文标题:vbscript - Javascript in HTA File - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741890864a2403293.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论